convert_factor_to_numeric: Convert a factor type to a numeric type levels() gets the...

Description Usage Arguments Value Examples

View source: R/convert_factor_to_numeric.R

Description

Convert a factor type to a numeric type levels() gets the factor levels as characters as.numeric() converts the factor levels to numeric subsetting the factor column by as.numeric(levels()) gives the numeric form of the factor column

Usage

1

Arguments

x

A vector of type factor

Value

A vector of type numeric

Examples

1
2
scores <- factor(x = c("1", "2"))
factor_to_numeric(scores)

antchau/glider documentation built on Dec. 1, 2020, 9:23 p.m.