dot-FactorColumns: Convert character columns to factors

Description Usage Arguments Details Value Examples

Description

.FactorColumns is an internal function that is not intended to be called by the user. It is called by other FIRST API methods.

Usage

1

Arguments

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.

Details

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.

Value

Data.frame

Examples

1
teams <- .FactorColumns(teams, c("districtCode", "stateProv", "country"))

irwinsnet/FIRST_api_R documentation built on Dec. 22, 2020, 5:12 p.m.