How to drop a variable in R?



I am currently working on data set in which I have created an additional variable name as a year .

mtcars$year <- 1974

I want to know If I want to delete this variable from the data set how I can perform this on R.


set the variable to NULL to drop it
mtcars$year <- NULL