metan (version 1.2.1)

desc_wider: Descriptive statistics from long to wide

Description

desc_wider 'widens' an object of class desc_stat increasing the number of columns and decreasing the number of rows. This is speccialy useful when the descriptive statistics were computed for each level of a factor using the function split_factors to pass subsetted data.to pass subsetted data to code.data.to pass subsetted data to code.data.

Usage

desc_wider(.data, var)

Arguments

.data

An output of the function desc_stat.

var

The variable in .data to show the results.

Value

A tibble with the statistics in the columns and levels of the factor(s) in the rows.

Examples

Run this code
# NOT RUN {
library(metan)

df <-
 data_ge2 %>%
 split_factors(GEN) %>%
 desc_stat(EP, EL, PH, CL,
           stats = c('mean, CI.mean, SE.mean, var.amo, CV'),
           verbose = FALSE)

print(df, n = 15)
desc_wider(df, PH)
# }

Run the code above in your browser using DataLab