$Budget(chr)"3,000.00", "2,000.00", "2,000.00"...
$Impressions(int) 0, 0, 0, 0...
$Interactions(int) 0, 0, 0...
$Interaction.Rate(chr) "0.00%", "0.00%", "0.00%"...
$Avg..Cost (dbl) 0, 0, 0, 0, 0, 0, 0...
$Cost(chr) "0", "0", "0", "0"...
$Clicks(int) 0, 0, 0, 0...
$CTR(chr) "0.00%", "0.00%", "0.00%"...
I have some columns.All of them have numeric values but when I imported them in R they appeared to be of a character data type.I want to convert these character to integer and also remove % sign from the columns that have them.
mData=mData %>%
mutate(Budget=as.numeric(Budget),
Interaction.Rate=as.numeric(gsub("%","",Interaction.Rate)),
Cost=as.numeric(Cost),
CTR=as.numeric(gsub("%","",CTR)))
I tried doing this but no result instead it gives me error:
Warning message: In eval(substitute(expr), envir, enclos) : NAs introduced by coercion
Can anyone help me out with this