groups_maxplot: Plots the variables with highest values in groups

Description Usage Arguments Value Note Author(s) References See Also Examples

View source: R/groups.R

Description

Plots the variables with highest values in groups within histograms.

Usage

1
groups_maxplot(data, classvar, m = 5, samebinsize = FALSE)

Arguments

data

A data frame.

classvar

A factor. The variable which is used to explain the numeric variables from x.

m

A positive integer. Number of plots to draw. Maximum is 10.

samebinsize

Logical. Whether or not bins are drawn with the same size. Default is FALSE.

Value

A ggplot object.

Note

You can only use factors with up to 7 different values.

Author(s)

Katrin Grimm

References

H. Wickham (2009) ggplot2: Elegant Graphics for Data Analysis New York: Springer

See Also

groups

Examples

 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)

mbgraphic documentation built on May 2, 2019, 2:45 a.m.