plotxc {condvis} | R Documentation |
Condition selector plot
Description
Data visualisations used to select sections for
ceplot
.
Usage
plotxc(xc, xc.cond, name = NULL, trim = NULL, select.colour = NULL,
select.lwd = NULL, cex.axis = NULL, cex.lab = NULL, tck = NULL,
select.cex = 1, hist2d = NULL, fullbin = NULL, ...)
Arguments
xc |
A numeric or factor vector, or a dataframe with two columns |
xc.cond |
Same type as |
name |
The variable name for |
trim |
Logical; if |
select.colour |
Colour to highlight |
select.lwd |
Line weight to highlight |
cex.axis |
Axis text scaling |
cex.lab |
Label text scaling |
tck |
Plot axis tick size |
select.cex |
Plot symbol size |
hist2d |
If |
fullbin |
A cap on the counts in a bin for the 2-D histogram, helpful with skewed data. Larger values give more detail about data density. Defaults to 25. |
... |
Passed to |
Value
Produces a plot, and returns a list containing the relevant information to update the plot at a later stage.
References
O'Connell M, Hurley CB and Domijan K (2017). “Conditional Visualization for Statistical Models: An Introduction to the condvis Package in R.”Journal of Statistical Software, 81(5), pp. 1-20. <URL:http://dx.doi.org/10.18637/jss.v081.i05>.
See Also
Examples
## 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")
## Effect of 'trim'.
x <- c(-200, runif(400), 200)
plotxc(x, 0.5, trim = FALSE, select.colour = "red")
plotxc(x, 0.5, trim = TRUE, select.colour = "red")