0
I have a dataframe with numbers separated by a comma but in the format integer but I need to change to numeric.
When using the function as.numeric(MEU_NUMERO) the number gets distorted.
0
I have a dataframe with numbers separated by a comma but in the format integer but I need to change to numeric.
When using the function as.numeric(MEU_NUMERO) the number gets distorted.
-1
Solution:
as.numeric(sub(",", ".", MEU_NUMERO, fixed = TRUE))
Browser other questions tagged r
You are not signed in. Login or sign up in order to post.
Please give an example of
MEU_NUMERO. This is a date.frame column with "numbers separated by comma"? Note that if the numbers are already class"integer", most likely is it is not necessary to change for"numeric".– Rui Barradas