Answers for "drop a column in r data frame"

C
3

r data frame remove column

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

drop a column in r data frame

df <- df %>%
  select(-column_to_drop)
Posted by: Guest on February-27-2021
-1

R drop columns

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

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

Code answers related to "C"

Browse Popular Code Answers by Language