drop columns by index r

Sure, here is a response:

To drop columns by index in R, you can use the following steps:

  1. Use the negative index to specify the columns you want to keep: data <- data[, -c(index1, index2)]

  2. Replace "data" with the name of your dataset and "index1, index2" with the column indexes you want to drop.