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