data.frame_tidiers | R Documentation |
Data frame tidiers are deprecated and will be removed from an upcoming release of broom.
## S3 method for class 'data.frame'
tidy(x, ..., na.rm = TRUE, trim = 0.1)
## S3 method for class 'data.frame'
augment(x, data, ...)
## S3 method for class 'data.frame'
glance(x, ...)
x |
A data.frame |
... |
Additional arguments for other methods. |
na.rm |
a logical value indicating whether |
trim |
the fraction (0 to 0.5) of observations to be trimmed from
each end of |
data |
data, not used |
These perform tidy summaries of data.frame objects. tidy
produces
summary statistics about each column, while glance
simply reports
the number of rows and columns. Note that augment.data.frame
will
throw an error.
tidy.data.frame
produces a data frame with one
row per original column, containing summary statistics of each:
column |
name of original column |
n |
Number of valid (non-NA) values |
mean |
mean |
sd |
standard deviation |
median |
median |
trimmed |
trimmed mean, with trim defaulting to .1 |
mad |
median absolute deviation (from the median) |
min |
minimum value |
max |
maximum value |
range |
range |
skew |
skew |
kurtosis |
kurtosis |
se |
standard error |
glance
returns a one-row data.frame with
nrow |
number of rows |
ncol |
number of columns |
complete.obs |
number of rows that have no missing values |
na.fraction |
fraction of values across all rows and columns that are missing |
David Robinson, Benjamin Nutter
Skew and Kurtosis functions are adapted from implementations in the moments
package:
Lukasz Komsta and Frederick Novomestky (2015). moments: Moments, cumulants, skewness,
kurtosis and related tests. R package version 0.14.
https://CRAN.R-project.org/package=moments
Other deprecated:
bootstrap()
,
confint_tidy()
,
finish_glance()
,
fix_data_frame()
,
summary_tidiers
,
tidy.density()
,
tidy.dist()
,
tidy.ftable()
,
tidy.numeric()
Other deprecated:
bootstrap()
,
confint_tidy()
,
finish_glance()
,
fix_data_frame()
,
summary_tidiers
,
tidy.density()
,
tidy.dist()
,
tidy.ftable()
,
tidy.numeric()
Other deprecated:
bootstrap()
,
confint_tidy()
,
finish_glance()
,
fix_data_frame()
,
summary_tidiers
,
tidy.density()
,
tidy.dist()
,
tidy.ftable()
,
tidy.numeric()
td <- tidy(mtcars)
td
glance(mtcars)
library(ggplot2)
# compare mean and standard deviation
ggplot(td, aes(mean, sd)) + geom_point() +
geom_text(aes(label = column), hjust = 1, vjust = 1) +
scale_x_log10() + scale_y_log10() + geom_abline()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.