The “describe” Function in R

  • Package: psych

  • Purpose: Descriptive statistics and exploratory data analysis.

  • General Class: Descriptive statistics.

  • Required Argument(s):

    • x: The data frame or matrix containing the variables to describe.

  • Notable Optional Arguments:

    • trim: Trims a percentage of data from both ends before computing statistics.

    • quant: Determines which quantiles to calculate (e.g., quant=c(0.25, 0.75) for quartiles).

  • Example:

  • library(psych)
    data <- data.frame(x = rnorm(100), y = rnorm(100))
    describe(data)

  • This example calculates and displays descriptive statistics for the variables in the “data” data frame.

Previous
Previous

The “describeBy” Function in R

Next
Next

The “h2o.ls” Function in R