hit5 <- read.csv("https://t1.daumcdn.net/cfile/blog/999FB3335BADBEDC24?download")
hit5$age <- c(30, 20, 28, 31, 30, 32, 37, 32,
37, 34, 36, 30,
30, 30, 28, 25, 28, 32, 28,
25, 28, 33, 32, 28,
29, 29, 28, 33, 34, 31, 39,
30, 29, 35, 29, 28,
26, 34, 31, 33, 28, 31, 22,
29, 29, 28, 29, 19,
31, 33, 33, 28, 19, 31, 34,
28, 28, 31, 27, 24,
31)
plot(hit5$age, hit5$TB,
pch=19, col="steelblue", cex=1.5,
main="나이와 타자 성적",
xlab="AGE", ylab="TB")
hit51 <- hit5[hit5$XR/hit5$PA>0.18,]
points(hit51$age, hit51$TB,
pch=19, col="red", cex=1.5)
text(hit51$age, hit51$TB,
pos=3, labels=hit51$name)
lines(lowess(hit5$TB~hit5$age), lwd=2, lty=3)
boxplot(hit5$TB~hit5$age)
plot(hit5$age, hit5$TB,
pch=19, col="steelblue", cex=1.5,
main="프로야구 타자 - 나이와 성적",
sub="red: XR/PA>0.18",
xlab="AGE", ylab="TB")
hit51 <- hit5[hit5$XR/hit5$PA>0.18,]
points(hit51$age, hit51$TB,
pch=19, col="red", cex=1.5)
text(hit5$age, hit5$TB,
pos=3, labels=hit5$name)
lines(lowess(hit5$TB~hit5$age), lwd=2, lty=3)
'R 데이터 분석' 카테고리의 다른 글
[R분석] 실전 EDA 탐색적분석 R 팁 3 (0) | 2018.10.05 |
---|---|
[R분석] LAD goes wrong. Why? a.f. 20180928 (0) | 2018.09.28 |
[R분석] KBO 프로야구 가을야구 stat 예상 분석 (0) | 2018.09.20 |
[R분석] EDA탐색적분석 base R (mtcars) (0) | 2018.09.18 |
[R분석] Anomaly Detection과 EDA 결합 (IsolationForest) 활용 (0) | 2018.09.05 |