1

My dataset has column "Installs" which has values like ("5,000+", "10,000+", .... )

When I try to convert it to numeric, it gives me NA values with an error:

df <- as.numeric(gsub(",","",df_dataset$Installs))

Warning message:
NAs introduced by coercion 

I want to replace both "+" and "," symbols. How can I acheive that?

Biswas Khayargoli
  • 976
  • 1
  • 11
  • 29

1 Answers1

1

Try removing all non numeric characters:

Installs_Numeric <- as.numeric(gsub("[,+]+", "", df_dataset$Installs))
Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360