Deal with Special Characters in Functions in R (2 Examples) | gsub(), grepl() & gregexpr() Functions

Описание к видео Deal with Special Characters in Functions in R (2 Examples) | gsub(), grepl() & gregexpr() Functions

How to manage special characters in functions such as gsub, grepl, and gregexpr in the R programming language. More details: https://statisticsglobe.com/deal-with...
R code of this video:

x <- "xxx $ xx ? xxxx [ xx \\ xxx" # Create example string
x # Print character string

gsub("$", "NEW", x) # Trying to replace special character

gsub("\\$", "NEW", x) # Replacing $

gsub("\\?", "NEW", x) # Replacing ?

gsub("\\[", "NEW", x) # Replacing [

gsub("\\\\", "NEW", x) # Replacing \

Follow me on Social Media:
Facebook:   / statisticsglobecom  
LinkedIn:   / statisticsglobe  
Reddit:   / joachimschork  
Twitter:   / joachimschork  

Комментарии

Информация по комментариям в разработке