Examveda

How do you remove a column named Income from a data frame named my_data in R?

A. my_data <- my_data[, -which(names(my_data) == "Income")]

B. my_data$Income <- NULL

C. drop_column(my_data, "Income")

D. remove_col(my_data, "Income")

Answer: Option B


This Question Belongs to R Programming >> Data Structures In R Programming

Join The Discussion

Related Questions on Data Structures in R Programming