Learn R Programming

mStats (version 3.2.2)

codebook: Codebook: Detailed information about variables

Description

codebook() provides detailed information about each variable within the dataset.

Usage

codebook(data)

Arguments

data

dataframe

Value

Codebook in data.frame format

Details

codebook generates the report of data structure with names, data lables, types, number of observations, number of observations with missing values and percentage of observations with missing values.

ANNOTATIONS:

Variable - Names of variables

Label - Labels of variables

Type - Types of variables

_Obs - Counts of valid observations

_NA - Counts of observations with missing value

_NA(%) - Percentage of observations with missing value

Examples

Run this code
# NOT RUN {
## use infert data
data(infert)
codebook(infert)

## add labels
infert.new <- labelVar(infert,
                       c(education, age, parity, induced, case, spontaneous,
                         stratum, pooled.stratum),
                       c("Education", "Age in years of case", "Count",
                         "# of prior induced abortions", "case status",
                         "# of prior spon. abortions",
                         "Matched set number", "Stratum Number"))
infert.new <- labelData(infert.new,
                        "Infertility after Spontaneous and Induced Abortion")
codebook(infert.new)


# }

Run the code above in your browser using DataLab