Reputation: 1432
I have a variable with 8 million or so values in my data frame that are formatted like this: 1.275.900.0
(character data type). Changing them to factors is a no go because it slows down processing, so I need numerics.
I tried getting rid of the decimals and performing data type coercion with . . .
df$variable = as.numeric(sub(".", "", df$variable, fixed=TRUE))
Unfortunately, I got Warning message:
NAs introduced by coercion.
How do I get around this?
Upvotes: 0
Views: 48