descstat {datana} | R Documentation |
A function that prepares a descriptive statistics table for continuous variables.
Description
Function that creates a descriptive statistics table for all continuous variables in a dataframe excluding missing values.
Usage
descstat(data = data, decnum = NA)
Arguments
data |
a dataframe containing variables as columns. |
decnum |
the number of decimals to be used in the output. |
Value
This function wraps descriptive statistics into a summarize table having the following descriptive statistics: sample size, minimum, maximum, mean, median, SD, and coefficient of variation (
Author(s)
Christian Salas-Eljatib and Tomas Cayul.
Examples
#creating a fake dataframe
set.seed(1234)
df <- as.data.frame(cbind(variable1=rnorm(5, 0), variable2=rnorm(5, 2)))
## adding one missing value
df[3,1] <- NA
df
#using the function
descstat(data=df)
descstat(data=df,decnum=1)
descstat(df,2)
[Package datana version 1.0.3 Index]