Answers for "how to remove columns from df in r"

4

r data frame remove column

df$columnName <- NULL
Posted by: Guest on May-29-2020
-1

R drop columns

undesired <- c('mpg', 'cyl', 'hp')

mtcars <- mtcars %>%
  select(-one_of(undesired))
Posted by: Guest on November-16-2020

Browse Popular Code Answers by Language