dnum: Create standard descriptive statistics

Description Usage Arguments Value See Also Examples

View source: R/dnum.R

Description

Wrapper for psych::describe that adds the name of the dataset and the variable being examined to its output. Used in dtable for multiple variables.

Usage

1
dnum(data1, neat = TRUE, sizesort = FALSE)

Arguments

data1

a data.frame column or columns, or a list

neat

logical, returns rounded values if TRUE

sizesort

logical, returns sorted data by mean if TRUE

Value

Returns a data.frame with common descriptive statistics for a numeric variable, as defined in psych::describe, concatenated with the name of the dataset and the name of the variable.

See Also

See dtable

See describe for more details on the descriptive statistics returned

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Single variable
dnum(iris2$Sepal.Length)
dnum(iris2["Sepal.Length"])
dnum(iris2[, "Sepal.Length"])

# Multiple variables
dnum(iris2[, c("Sepal.Length", "Sepal.Width")])

# Will not save you from yourself (will create numeric data for factors):
dnum(iris2$Species)

dtables documentation built on May 1, 2019, 6:48 p.m.