describe: Describe the variables of a data.frame

describeR Documentation

Describe the variables of a data.frame

Description

This function describes the variables of a vector or a dataset that might include labels imported with haven packages.

Usage

describe(x, ...)

## S3 method for class 'factor'
describe(x, n = 10, show.length = TRUE, freq.n.max = 10, ...)

## S3 method for class 'numeric'
describe(x, n = 10, show.length = TRUE, freq.n.max = 10, ...)

## S3 method for class 'character'
describe(x, n = 10, show.length = TRUE, freq.n.max = 10, ...)

## Default S3 method:
describe(x, n = 10, show.length = TRUE, freq.n.max = 10, ...)

## S3 method for class 'haven_labelled'
describe(x, n = 10, show.length = TRUE, freq.n.max = 10, ...)

## S3 method for class 'data.frame'
describe(x, ..., n = 10, freq.n.max = 0)

## S3 method for class 'description'
print(x, ...)

Arguments

x

object to describe

...

further arguments passed to or from other methods, see details

n

number of first values to display

show.length

display length of the vector?

freq.n.max

display a frequency table if the number of unique values is less than this value, 0 to hide

Details

When describing a data.frame, you can provide variable names as character strings. Using the "*" or "|" wildcards in a variable name will search for it using a regex match. The search will also take into account variable labels, if any. See examples.

Value

an object of class description.

Author(s)

Joseph Larmarange <joseph@larmarange.net>

See Also

lookfor

Examples

data(hdv2003)
describe(hdv2003$sexe)
describe(hdv2003$age)
describe(hdv2003)
describe(hdv2003, "cuisine", "heures.tv")
describe(hdv2003, "trav*")
describe(hdv2003, "trav|lecture")
describe(hdv2003, "trav", "lecture")

data(fertility)
describe(women$residency)
describe(women)
describe(women, "id")

questionr documentation built on Feb. 16, 2023, 10:14 p.m.