makecategorical: makecategorical converts given variables into categorical...

View source: R/cpuefuncs.r

makecategoricalR Documentation

makecategorical converts given variables into categorical factors

Description

makecategorical given a list of variables, as character strings, this function converts each variable into a factor after checking no mistake has been made with the spelling of the variable name. A copy of the data is made so that any non-categorical variables can be retained. Any interaction terms included must be last in the vector making up labelModel

Usage

makecategorical(labelModel, indat)

Arguments

labelModel

is the set of variables/column names from the data.frame that are to be converted into categorical factors. Any interaction terms should come last.

indat

is the data.frame that is to be analysed in the standardization

Value

a copy of the database with the selected variables converted into factors

Examples

## Not run: 
  data(abeg)
  labelM <- c("year","diver","month")
  ab1 <- makecategorical(labelM,abeg)

## End(Not run)

haddonm/rforcpue documentation built on Oct. 12, 2024, 11:55 p.m.