После прочтения моего .CSV
файла в R между ними много лишних пробелов. Как мне их устранить?
file = read.csv("filename.csv")
После прочтения файла я получаю много пробелов между ними, как удалить в R ?
a = data.frame(Answer = c("who doesn't like some appreciation now and then all employees can give receive non monetary awards in the form of e cards please use the recognition awards and follow instructions there to send an e card want to send some appreciation my way ")
В другой ситуации я использовал приведенный ниже код для удаления апострофа, такого как doesn't
, чтобы получить doesnt
, но я получаю doesn t
:
a$Answer=gsub('[[:punct:] ]+',' ',a$Answer)
Как правильно удалить апостроф без пробела?