I have a dataframe with a variable that is a factor containing $ signs. So the column is something like Revenue: $450, $550, $650 ..etc. I'd like to strip the $ and transform factor to numeric.
I tried parsing using methods found on stackoverflow but they return and error message. Are $ special symbols?
Here's what I've tried:
str_replace(df$Revenue, "$", "") #error message
as.numeric(gsub("$", "", df$Revenue) #Similar error message
These work to remove symbols like "%" but for some reason not replicable with "$". Any reason why?