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

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -