Skip to content
Prev 317543 / 398503 Next

Looking for an easy way to change the names of a vector

Hello,

Use ifelse, and assign its values to names(Data)


ifelse(grepl(" ", names(Data)), gsub(" ", "-", names(Data)), 
paste0(names(Data), "-XXX"))


Hope this helps,

Rui Barradas
Em 14-02-2013 11:43, Christofer Bogaso escreveu: