I am trying to make a column easier to read. Right now, the data looks like this (also this is my first time using stackoverflow.com so ignore any wrong formatting!):
**Money**
16k
42.3k
15
8900
This is currently being read as character values and not numeric. I want to have all these values standardized, so I want to get rid of the "k". I thought I would do this:
data$money<- data$money %>%
str_replace('k', '') %>%
as.numeric()
But now my issue is getting the values to show up correctly. So for example, 16k is actually is 16,000 but 42.3k is actually 42,300 and I cannot do:
data$money <- data$money * 1000
because it would be inaccurate since 15 and 8900 should be kept as 15 and 8900, and not 15,000 and 8,900,000. Any tips on what to do? Thanks so much!