Description Usage Arguments Value Examples
View source: R/insertDiffLevCol.R
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.
1 | insertDiffLevCol(dfData, dfColNameVec, numBreaksVec)
|
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 |
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.
1 2 | insertDiffLevCol(iris,"Sepal.Length",5)
insertDiffLevCol(iris,c("Sepal.Length","Sepal.Width"),c(4,5))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.