R - Transforme como fator
df$myvar <- as.numeric(as.character(df$myvar))
df$myvar <- as.factor(df$myvar)
Andrea Perlato
df$myvar <- as.numeric(as.character(df$myvar))
df$myvar <- as.factor(df$myvar)