Answers for "removing columns using index in r"


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

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

Browse Popular Code Answers by Language