본문 바로가기
R/R terminal mode

R - 변수이름 바꾸기

by 거인과난쟁이 2012. 5. 6.

변수이름을 바꿔야 할 경우가 흔히 발생한다. 


> test.matrix <- matrix(sample(1:12), ncol=3)

> test.data.frame <- as.data.frame(test.matrix)

> str(test.data.frame)

> names(test.data.frame)[c(2)] <- c("둘")

> str(test.data.frame)