개요
- R 데이터프레임 컬럼 제거
이름으로 제거
options(echo=T)
df = iris
head(df)
df = df[!(names(df) %in% c("Petal.Length","Petal.Width"))]
head(df)
n번째 컬럼 제거
options(echo=T)
df = iris
head(df)
df = df[-c(3,4)]
head(df)
options(echo=T)
df = iris
head(df)
df = df[!(names(df) %in% c("Petal.Length","Petal.Width"))]
head(df)
options(echo=T)
df = iris
head(df)
df = df[-c(3,4)]
head(df)