insertDiffLevCol: insertDiffLevCol

Description Usage Arguments Value Examples

View source: R/insertDiffLevCol.R

Description

sinsertDiffLevCol takes as input a data.frame object (dfData), a vector containing column names (dfColNameVec) and a numeric vector (numBreaksVec) containing the number of class divisions for each column in dfColNameVec 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
insertDiffLevCol(dfData, dfColNameVec, numBreaksVec)

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.

numBreaksVec

a vector of class numeric containing the number of class divisions (or exact boundaries) that should be taken for each column in dfColNameVec. The length of the vector must be equal to the length of dfColNameVec.

Value

insertDiffLevCol 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
insertDiffLevCol(iris,"Sepal.Length",5)
insertDiffLevCol(iris,c("Sepal.Length","Sepal.Width"),c(4,5))

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