How to format the.Numeric() a comma number in R?

Asked

Viewed 128 times

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

    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".

1 answer

-1

Solution:

as.numeric(sub(",", ".", MEU_NUMERO, fixed = TRUE))

Browser other questions tagged

You are not signed in. Login or sign up in order to post.