Answers for "how to remove column with index in dataframe in r"

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

how to remove columns in a table in r

# delete multiple columns in r 
# delete column in R by mapping Null value to them
dataset$firstcol <- dataset$nextcol <- dataset$anothercol <- NULL
Posted by: Guest on May-09-2021

Code answers related to "how to remove column with index in dataframe in r"

Browse Popular Code Answers by Language