insertEqLevCol: insertEqLevCol

Description Usage Arguments Value Examples

View source: R/insertEqLevCol.R

Description

insertEqLevCol takes as input a data.frame object (dfData), a vector containing column names (dfColNameVec), and the number of class divisions (numBreaks) and inserts a new column in dfData for each column in dfColNameVec containing the factor classes corresponding to the entries in that column.

Usage

1
insertEqLevCol(dfData, dfColNameVec, numBreaks)

Arguments

dfData

a data.frame object. Note that this is not a character string but the data.frame object itself. The parameter passed to the function should be without quotes (" ").

dfColNameVec

a character string or a vector of class character indicating the name(s) of the column(s) to be handled.

numBreaks

an integer indicating the number of class divisions (or exact boundaries) that should be taken. The same number of divisions is used for all columns in dfColNameVec.

Value

insertEqLevCol updates the data.frame object dfData by adding new columns containing factor classes corresponding to the entries in the respective columns specified by dfColNameVec of the original data.frame.

Examples

1
2
insertEqLevCol(iris,c("Sepal.Length","Sepal.Width"),4)
insertEqLevCol(iris,c("Sepal.Length","Petal.Length"),10)

lwTools/agriTrf documentation built on March 26, 2020, 12:09 a.m.