Remove All White Space from Character String in R (2 Examples) | Delete Blanks | gsub & str_replace

preview_player
Показать описание
R code of this video:

x <- " AAA BBB CCC DDD " # Create example string
x # Print example string

x_new1 <- gsub(" ", "", x) # Applying gsub function
x_new1 # Printing output to console

library("stringr")

x_new2 <- str_replace_all(x, " ", "") # Applying str_replace_all function
x_new2 # Printing output to console

Follow me on Social Media:
Рекомендации по теме
Комментарии
Автор

Thanks for the tutorial, Joachim, and have a great weekend!!

agsoutas
Автор

Great Vedios, simple and short well explained .Please make some videos on shiny( if possible) or could you please provide some resources on the same

Mahesh-ynkz