Answers for "r remove index from dataframe"

R
2

drop columns by index r

#drop columns by index
df <- mydata[ -c(1,3:4) ]
#drop columns by name
df = subset(mydata, select = -c(x,z))
Posted by: Guest on November-13-2020
0

r remove column by index

DT[, coltodelete := NULL]
Posted by: Guest on May-15-2021

Code answers related to "r remove index from dataframe"

Browse Popular Code Answers by Language