Skip to content
Snippets Groups Projects
Commit af76eacf authored by rkr2's avatar rkr2
Browse files

Updated report and question 4 viz

parent 0b014163
No related branches found
No related tags found
No related merge requests found
File added
#### Who has performed better, Left Handed or Right Handed Pitchers? Has this trend changed over time?
##### Visualizing the Data
We were able to use Apache Spark to extract data that would help us determine the performance of right
......@@ -28,8 +27,8 @@ begin the visualization by reading the summary from the comma delimited file.
```{r}
# Read the data from the CSV
question4aData <- read.csv(file = 'spark_question4_BAOpp_right_vs_lefty_pitchers.csv')
question4bData <- read.csv(file = 'spark_question4_ERA_right_vs_lefty_pitchers.csv')
question4aData <- read.csv(file = './spark_question4_BAOpp_right_vs_lefty_pitchers.csv')
question4bData <- read.csv(file = '../reports/spark_question4_ERA_right_vs_lefty_pitchers.csv')
```
The visualizations are generated using the highcharter package which generates highcharts visualizations
......@@ -47,13 +46,11 @@ chart4a <- hchart(question4aData, "line", hcaes(x = yearID, y = BAOpp, group = t
hc_credits(enabled = TRUE, text = "Source: Sean Lahman, Baseball Database Website",
href = "http://www.seanlahman.com/baseball-archive/statistics/",
style = list(fontSize = '10px'))
```
```{r}
# Display the visualization
chart4a
```
```{r}
chart4b <- hchart(question4bData, "line", hcaes(x = yearID, y = ERA, group = throws)) %>%
hc_title(text = 'Left Handed vs Right Handed Pitching Earned Runs Average Over Time') %>%
......@@ -62,11 +59,8 @@ chart4b <- hchart(question4bData, "line", hcaes(x = yearID, y = ERA, group = thr
hc_credits(enabled = TRUE, text = "Source: Sean Lahman, Baseball Database Website",
href = "http://www.seanlahman.com/baseball-archive/statistics/",
style = list(fontSize = '10px'))
```
```{r}
# Display the visualization
chart4a
chart4b
```
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment