questionr (version 0.6.3)

describe: 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 factor describe(x, n = 10, show.length = TRUE, freq.n.max = 10, ...)

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

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

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

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

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

# S3 method for 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

Value

an object of class description.

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.

See Also

lookfor

Examples

Run this code
# NOT RUN {
data(hdv2003)
describe(hdv2003$sexe)
describe(hdv2003$age)
data(fecondite)
describe(femmes$milieu)
describe(hdv2003)
describe(hdv2003, "cuisine", "heures.tv")
describe(hdv2003, "trav*")
describe(hdv2003, "trav|lecture")
describe(hdv2003, "trav", "lecture")
describe(femmes)
describe(femmes, "ident")
# }

Run the code above in your browser using DataCamp Workspace