can't transform to numeric

hello R community.
I'm trying to make this data's salary (I can't share my csv file as it seems) data numeric as such:

data$salary<-as.numeric(data$salary)

but it's ending up as "double", how can I solve this problem?
thanks a lot, in advance <3!

Hi @maaanaaa21. "double" is a numeric data type. Here is an explanation from R for Data Science.

20.3.2 Numeric

Integer and double vectors are known collectively as numeric vectors. In R, numbers are doubles by default. To make an integer, place an L after the number:

1 Like

You can also use as.integer() instead of as.numeric()

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.