Answers for "factor in r"

R
0

factor in r

# This returns a character vector, the as.numeric() function
# is still required to convert the values to the proper type (numeric).
f <- levels(f)[f]
f <- as.numeric(f)
Posted by: Guest on February-04-2021

Browse Popular Code Answers by Language