describe_by | R Documentation |
This is a re-implementation of the psych::describeBy function using the dplyr
package for creating the resulting table. The goal is for this function to be
a drop-in replacement, however the results are always returned as a data.frame
consistent with the mat = TRUE
parameter setting.
describe_by(x, group = NULL, type = 3, trim = 0.1, na.rm = TRUE, mat, ...)
x |
a numeric vector to summarize. |
group |
a grouping vector. |
type |
type of skewness, see psych::skew for details. |
trim |
the fraction (0 to 0.5) of observations to be trimmed from each end of x before the mean is computed. Values of trim outside that range are taken as the nearest endpoint. |
na.rm |
a logical evaluating to TRUE or FALSE indicating whether NA values should be stripped before the computation proceeds. |
mat |
not used, provided to provide direct compatability with psych::describeBy. |
... |
not currently used. Included to ensure compatibility. |
The psych
package is an incredibly useful package but some of the dependencies
are problematic for deploying Shiny applications using shinylive
. Since this
package only uses the describeBy
function from the psych
package, we
re-implemented it in order to remove the dependency on the psych
package.
a data.frame with the summary statistic.
data(mtcars)
describe_by(mtcars$mpg, group = mtcars$cyl)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.