showContents: Show variable information in data.frame

Description Usage Arguments Details Value See Also Examples

View source: R/showContents.R

Description

Show variable information in data.frame.

Usage

1
2
showContents(data = NULL, functions = c(modes), na.action = "na.pass",
  na.omit.for.variable = TRUE, show.nobs = TRUE)

Arguments

data

a data.frame whose contents to be shown

functions

a vector of functions to be applied to each variable in data.frame. Default added function is mode, which is almost same functionality as storage.mode except that factor is separated from integer.

na.action

a character which specifies missing-data filter function. This is applied to data.frame supplied by data argument. Default is ‘na.pass’.

na.omit.for.variable

a logical value specifying whether to apply na.omit for each variable. This option is useful to supply NA free data to each function. When set to TRUE (default), the number of observation may differ for each variable, and it is recommended to check the number of obsevations by show.nobs option.

show.nobs

a logical valye specifying whether to add the number of observations for each function as nobs column in result object.

Details

This function shows contents in data.frame object, and typical use is to list modes of variables in data.frame. In addition to variable mode, a variety of functions can be used such as min, max and mean for summarizing variable information in data.frame.

Value

a data.frame which contains the results of each function.

See Also

countNA

Examples

1
2
3
4
5
dat <- data.frame(a = rnorm(100))
dat <- transform(dat, b = ifelse(a > -2, a, NA))
dat <- transform(dat, c = ifelse(a > 0, "positive", "negative"))
showContents(dat)
showContents(dat, functions=c(modes, storage.mode, min, max, median))

epifit documentation built on May 29, 2017, 3:43 p.m.