| descplot | R Documentation |
Applies descdata to the selected columns and produces a plot showing the descriptive statistics. The plot is generated using ggplot2 and a suitable melt function.
descplot(data, cols = NULL, stats = 1:9, first = "variables",
ncol = NULL, num_xaxis = "log", verbose = FALSE)
data |
A data frame containing numeric columns to describe. |
cols |
Column indices or names of numeric variables. If |
stats |
Statistics to plot, as in |
first |
Name for the variable identifier column (passed to |
ncol |
Number of columns in the facet layout (passed to |
num_xaxis |
How to treat numeric column names on the x-axis. Options:
|
verbose |
Logical; if |
This function first calls descdata and then melts the result into a long format suitable for ggplot2. If the column names of the original data are numeric, the plot uses a logarithmic x-axis and line geometry; otherwise, a bar plot is produced. The num_xaxis parameter allows overriding the default log transform.
A ggplot object displaying the descriptive statistics.
Chun-Sheng Liang <chun-shengliang@qq.com>
1. Example data is from https://smear.avaa.csc.fi/download. It includes particle number concentrations in SMEAR I Varrio forest. 2. Wickham, H. 2016. ggplot2: elegant graphics for data analysis. Springer-Verlag New York.
descplot(data, cols = 5:65)
descplot(data, cols = 5:65, stats = c("min","max","IQR"), num_xaxis = "numeric")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.