Is there a way to rename specific columns in R data frame.
asd <- data.frame(asdds = c(1,2), sfrfr = c(3,4), dsfsg = c(4,5))
asd
asdds sfrfr dsfsg
1 1 3 4
2 2 4 5
colnames(asd[1]) <- c(substring(names(asd[1]), 4))
I am trying to replace first columns with its substring
Expected output
asd
ds sfrfr dsfsg
1 1 3 4
2 2 4 5