r how to remove the factor of numeric to get only the numeric valur code example
Example 1: R factors as numeric
as.numeric(levels(f))[f] # f being the factor column
Example 2: r - transform as factor
df$myvar <- as.numeric(as.character(df$myvar))
df$myvar <- as.factor(df$myvar)