I have a set of postcodes in one column in a large dataset. I want to take out the middle white space, e.g I would like "ABC 123" to be "ABC123". I've tried using str_squish and I can't get it to work. Can someone suggest the correct usage for the code below please or another method - many thanks.
#install.packages("tidyverse") library(tidyverse) df <- tibble( Postcode = c("ABC 123", "ABC 124", "CDE 125"), Area = c(1:3) ) df %>% str_squish(Postcode)