I have a data set hdata(as picture1 shows):
row names were automatically given by R
How do I name rows by y1 to y6 instead of v1
to v6
given by R?
We can change the column names with paste
colnames(hdata) <- paste0('y', seq_along(hdata))
Or use sub
colnames(hdata) <- sub('v', 'y', colnames(hdata))