Learn R Programming

dtables (version 0.2.0)

dnum: Create standard descriptive statistics

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

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

Run this code

# 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)

Run the code above in your browser using DataLab