Re: [R] using mutate to remove all white space

2020-03-01 Thread Rui Barradas
Hello, Here are 2 examples, one with stringr::str_remove_all and the other with base gsub. I am assuming that you want to remove the spaces from column 'servicer'. dat <- data.frame(x = rnorm(2), servicer = c("a b c", " d efg"), fctrdt = 1:2) dat library

Re: [R] using mutate to remove all white space

2020-03-01 Thread Bert Gunter
I don't use dplyr, but it's trivial with gsub, assuming I understand correctly: > x <- "a b\t c\n e" > cat(x) a b c e > gsub("[[:space:]]", "",x) [1] "abce" See ?regex for details (of course!), especially the section on character classes. Bert Gunter "The trouble with having an open mind is

[R] using mutate to remove all white space

2020-03-01 Thread Glenn Schultz via R-help
All, This may not be the proper place to ask as the question is dplyr and removing white space using mutate.  My code is below: ```{r, echo = FALSE, message = FALSE conn <- myconnection ```{r, echo = FALSE, message=FALSE} fhlloanbalance <- tbl(conn, "fhlloan_balance_view") colnames(fhlloa