I have a simple CSV file:
Alpha Beta Gamma
1 4 4
2 6 3
How can I add a specific integer or string to the column names, say 1 or “June”? The output I would expect is:
Alpha_1 Beta_1 Gamma_1
1 4 4
2 6 3
Use
pasteorpaste0withnames.Assuming your
data.frameis calledtest:names(test) = paste0(names(test), "_1")