0

I want to keep a string that is only letters, numbers or underscore. However when I use

gsub('[^A-z0-9_]',"","some lab value (x10^9L)")

I get

[1] "somelabvaluex10^9L"

Which is unexpected since ^ character is kept in the string. I tried different options without any luck.

Wietze314
  • 5,797
  • 2
  • 20
  • 36

0 Answers0