powered by
Internal function only, not meant for general use Simple wrapper around ggplot2 functionaly to create density plots, potentially for many variables and coloured by group.
ldensity(data, melt = FALSE, x, facet, g, hist = FALSE)
A dataset (or melt()ed dataset)
Logical whether to melt() dataset
name of variable for density
A variable to use for facetting
A variable to use for grouping/colouring. If melt=TRUE, this is used as id.var as well.
melt=TRUE
Logical whether to make a density plot or histogram (if TRUE).
A ggplot2 graph.
# NOT RUN { # simple facetted plot pscore:::ldensity(mtcars, TRUE) # simple coloured plot pscore:::ldensity(mtcars, x = "mpg", g = "cyl") # }
Run the code above in your browser using DataLab