How to replace symbol 'phi' in R? -
i using
record$name <- gsub(pattern="phi",replacement="",x=record$name) the above replaces 'phi' in 'graphics', way in r?
try using gsub(pattern="^phi$",replacement="",x=record$name)
example, consider following vector of strings:
> string <- c("phi", "graphics", "graphics") > gsub("^phi$", "", string) [1] "" "graphics" "graphics"
Comments
Post a Comment