[R] 탐색적 데이터 분석: 다중변수 데이터 분석
Y
Yerim
- R
plot(x, y, main = '제목',
xlab = 'x축라벨',
ylab = 'y축라벨')pairs(target, main = '제목')point <- as.numeric(데이터셋$대상열)
color <- c(색 지정)
plot(dataset, main = '제목',
pch = c(point),
col = color[point])# (1) 데이터의 확인
head(cars)
# (2) 산점도의 작성
plot(cars$speed,
cars$sit,
main='자동차 속도와 제동거리',
xlab='속도',
ylab='제동거리')
# (3) 상관계수
cor(cars$speed, cars$dist)# (1) 데이터 확인
st <- data.frame(state.x77)
head(st)
# (2) 다중 산점도 작성
plot(st)
# (3) 다중 상관계수
cor(st)plot(x, y, main = '제목',
type = 'l', lty = 1, lwd = 1,
xlab = '시간', ylab = '값')plot(...)
lines(x, y, type='b', col='색')