Can you please help me to remove a space from the ID column in my data? I have data frame like this:
df<-data.frame(
"ID" = c("G 249485", "L 938495", "N 234987"), type=c("a","b","c"))
Can you please help me to remove a space from the ID column in my data? I have data frame like this:
df<-data.frame(
"ID" = c("G 249485", "L 938495", "N 234987"), type=c("a","b","c"))
or
library(dplyr)
df %>%
dplyr::mutate(ID = stringr::str_remove(ID, pattern = "\\s"))
ID type
1 G249485 a
2 L938495 b
3 N234987 c