文字の結合 paste
「sep = “”」をいれることで文字の間をなくすこともできます。「sep = “-“」といれることであえて文字をいれることもできます。
x <- "abc"
y <- "xyz"
paste(x,y)
## [1] "abc xyz"
文字列の置換 gsub
gsub(pattern = "a",
replacement = "",
x = x)
文字列の検索 grepl
> grepl(pattern = "a",x = x)
[1] TRUE
> grepl(pattern = "a",x = y)
[1] FALSE