From d1df30ecec2356b903550871841cd97e5b27ce38 Mon Sep 17 00:00:00 2001 From: Russell Date: Sat, 6 Jan 2018 12:13:55 -0500 Subject: [PATCH 1/4] Fix typos for Chapter 3 script --- scripts/Chap3.graphics.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/Chap3.graphics.R b/scripts/Chap3.graphics.R index 71575d8..d871cc3 100644 --- a/scripts/Chap3.graphics.R +++ b/scripts/Chap3.graphics.R @@ -42,7 +42,7 @@ barplot(table(hof$Era)) plot(table(hof$Era)) dev.off() -# Section 2.4 Dot plots +# Section 3.4 Dot plots T.Era <- table(hof$Era) dotchart(as.numeric(T.Era), labels=names(T.Era), xlab="Frequency") @@ -51,7 +51,7 @@ hof.500 <- subset(hof, HR >= 500) hof.500 <- hof.500[order(hof.500$OPS), ] dotchart(hof.500$OPS, labels=hof.500$X, xlab="OPS") -# Section 2.5 Numeric Variable: Stripchart and Histogram +# Section 3.5 Numeric Variable: Stripchart and Histogram windows(width=7, height=3.5) stripchart(hof$MidCareer, method="jitter", pch=1, @@ -63,7 +63,7 @@ hist(hof$MidCareer, xlab="Mid Career", main="") hist(hof$MidCareer, xlab="Mid Career", main="", breaks=seq(1880, 2000, by=20)) -# Section 2.6 Two Numeric Variables +# Section 3.6 Two Numeric Variables with(hof, plot(MidCareer, OPS)) with(hof, lines(lowess(MidCareer, OPS, f=0.3))) @@ -186,4 +186,4 @@ text(10440, 65, "62") legend(10440, 20, legend=c("McGwire (70)", "Sosa (66)"), lwd=2, col=c("black", "grey")) -######################################################### \ No newline at end of file +######################################################### From 51988040fe956f4533dcf79ee124cdb09de258d2 Mon Sep 17 00:00:00 2001 From: Russell Date: Sat, 6 Jan 2018 12:39:04 -0500 Subject: [PATCH 2/4] Fix Chapter 3 typos --- scripts/Chap3.graphics.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Chap3.graphics.R b/scripts/Chap3.graphics.R index d871cc3..48af401 100644 --- a/scripts/Chap3.graphics.R +++ b/scripts/Chap3.graphics.R @@ -16,7 +16,7 @@ hof$MidCareer <- with(hof, (From + To) / 2) hof$Era <- cut(hof$MidCareer, breaks = c(1800, 1900, 1919, 1941, 1960, 1976, 1993, 2050), - labels = c("19th Century", "Lively Ball", "Dead Ball", + labels = c("19th Century", "Dead Ball", "Lively Ball", "Integration", "Expansion", "Free Agency", "Long Ball")) From d455856c2d1472d7c252dbbe77c44e6214cf5151 Mon Sep 17 00:00:00 2001 From: Russell Date: Sat, 6 Jan 2018 12:46:19 -0500 Subject: [PATCH 3/4] Fix Chap 3 typos --- scripts/Chap3.graphics.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Chap3.graphics.R b/scripts/Chap3.graphics.R index 48af401..69d1403 100644 --- a/scripts/Chap3.graphics.R +++ b/scripts/Chap3.graphics.R @@ -127,7 +127,7 @@ bonds.info <- getinfo("Barry", "Bonds") arod.info <- getinfo("Alex", "Rodriguez") ruth.info -batting <- read.csv("lahman/Batting.csv") +batting <- read.csv("Batting.csv") ruth.data <- subset(batting, playerID == ruth.info$name.code) ruth.data$Age <- ruth.data$yearID - ruth.info$byear From 576e38e01248e65673739d76563134e8f4321833 Mon Sep 17 00:00:00 2001 From: Russell Date: Sat, 6 Jan 2018 13:11:05 -0500 Subject: [PATCH 4/4] Fix chapter 2 typos --- scripts/Chap2.introduction.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Chap2.introduction.R b/scripts/Chap2.introduction.R index 30f7550..3186ae5 100644 --- a/scripts/Chap2.introduction.R +++ b/scripts/Chap2.introduction.R @@ -132,7 +132,7 @@ Age <- 19 : 29 HR.Rates <- hr.rates(Age, HR, AB) Mantle <- cbind(Age, HR, AB, Rates=HR.Rates$y) -write.csv(Mantle, "..\output\mantle.csv", row.names=FALSE) +write.csv(Mantle, "../output/mantle.csv", row.names=FALSE) # Section 2.7 Data Frames