After importing a file, I always try try to remove spaces from the column names to make referral to column names easier.
Is there a better way to do this other then
Alternatively, you may be able to achieve the same results with the stringr package.
stringr
names(ctm2) <- names(ctm2) %>% stringr::str_replace_all("\\s","_")