Description Usage Arguments Value Note Author(s) References See Also Examples
Plots the variables with highest values in groups within histograms.
1 | groups_maxplot(data, classvar, m = 5, samebinsize = FALSE)
|
data |
A data frame. |
classvar |
A factor. The variable which is used to explain the numeric variables from |
m |
A positive integer. Number of plots to draw. Maximum is |
samebinsize |
Logical. Whether or not bins are drawn with the same size. Default is FALSE. |
A ggplot object.
You can only use factors with up to 7 different values.
Katrin Grimm
H. Wickham (2009) ggplot2: Elegant Graphics for Data Analysis New York: Springer
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | data(Election2005)
## Not run:
# Define new variable which explains affiliation of the constituencies
# to east Germany, west Germany and Berlin
OstWest <- ifelse(Election2005$Land %in%
c("Thueringen","Sachsen","Sachsen-Anhalt",
"Brandenburg","Mecklenburg-Vorpommern"), "Ost", "West")
Election2005$OstWestBerlin <-
as.factor(ifelse(Election2005$Land == "Berlin","Berlin",OstWest))
# Plot 5 variables with highest values in groups
groups_maxplot(Election2005,"OstWestBerlin")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.