Description Usage Arguments Value Examples
Creates my most common univariate plot - the target variable averaged at different levels of x and superimposed over a histogram showing the population distribution across the different values of x. The returned plot is a ggplot2 object.
1 2 3 4 5 |
y |
- The target variable |
x |
- The independent variable. |
xlab |
- x-axis label, straight from qplot. |
ylab |
- y-axis label, straight from qplot. |
main |
- Main title, straight from qplot. |
num.switch |
- Binary. True if we should treat x as numeric, false if categorical. |
col |
- Color of the univariate line, straight from qplot. |
lwd |
- Histogram width control. Should default to something sensible. |
Returns a ggplot object with the mean value of y plotted over x, and a histogram overlayed in the background.
1 2 3 4 5 | perf.plot(as.integer(iris$Species == "virginica"),iris[,1])
perf.plot(as.integer(iris$Species == "virginica"),iris[,2])
perf.plot(as.integer(iris$Species == "virginica"),iris[,3])
perf.plot(as.integer(iris$Species == "virginica"),iris[,1], num.switch=FALSE)
perf.plot(as.integer(iris$Species == "virginica"),iris[,3], num.switch=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.