I need help with finding a pattern and replacing it by two different ways. For example, the word "Code/i" should be replaced with "Code, Codi". What code should i use in replacement to get two results separated by comma? I am new to R and assuming some metacharacters or regex needs to be used? Also, i need to use base functions and no external packages. Appreciate any feedback and help as im stuck! Thanks
a <- c("Code/i")
gsub(pattern = "/i", replacement= "", a)
Aucun commentaire:
Enregistrer un commentaire