## histogram, highlighting the first case
data(mtcars)
obj <- plotxc(mtcars[, "mpg"], mtcars[1, "mpg"])
obj$usr
## barplot, highlighting 'cyl' = 6
plotxc(as.factor(mtcars[, "cyl"]), 6, select.colour = "blue")
## scatterplot, highlighting case 25
plotxc(mtcars[, c("qsec", "wt")], mtcars[25, c("qsec", "wt")],
select.colour = "blue", select.lwd = 1, lty = 3)
## boxplot, where 'xc' contains one factor, and one numeric
mtcars$carb <- as.factor(mtcars$carb)
plotxc(mtcars[, c("carb", "wt")], mtcars[25, c("carb", "wt")],
select.colour = "red", select.lwd = 3)
## spineplot, where 'xc' contains two factors
mtcars$gear <- as.factor(mtcars$gear)
mtcars$cyl <- as.factor(mtcars$cyl)
plotxc(mtcars[, c("cyl", "gear")], mtcars[25, c("cyl", "gear")],
select.colour = "red")
Run the code above in your browser using DataLab