Description Usage Arguments Details Value Examples
.FactorColumns
is an internal function that is not intended to be
called by the user. It is called by other FIRST API methods.
1 | .FactorColumns(df, cols)
|
df |
The data.frame that will have it's columns converted to factors. |
cols |
A character vector of column names that identifies the columns that will be converted to factors. |
There are benefits to converting data frame columns with a limited number of unique character values to factors. For example, the R barplot function will automatically group values by factors, which could be a team, district, etc. Factors are conceptually similar to enumerations in other programming languages.
Data.frame
1 | teams <- .FactorColumns(teams, c("districtCode", "stateProv", "country"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.