--- title: 'Homework: Ggplot/plotly' author: Group 3 date: "12/5/2017" output: html_document --- ## Problem 1: Baseball For this question, you will need the file `baseball.csv`, which was described in the lecture. a.) Examine the relationship between each of the three offensive performance metrics (o_Eye, o_Average, and o_Power) with Winning Percentage by both Major and Minor league teams by fitting separate regression lines by league for each metric. Compare and contrast the strength of association between each. Make sure to appropriately format and label your plots. b.) Create a boxplot of Batting Average (o_average) for both Major and Minor league teams. Make sure to display Q1, Median and Q3 in the boxplot(use `add_text`). Briefly comment on any differences in distribution of average between leagues. ## Problem 2: Stock Data Fetch historical stock quote data of AAPL from Yahoo!. Make a candlestick plot for the year 2017.Try to match the plot as shown here. Make sure the following parts are included: * title, y-axis names * a volume bar in the bottom (no range selector) * colors: red for up day, green for down day * annotation * (optional) buttons for the latest 6 months, 3 months and 1 month, and a reset button ## Problem 3: 3D Plotting Based on the data of "gapminderDataFiveYear.csv"(https://raw.githubusercontent.com/plotly/datasets/master/gapminderDataFiveYear.csv), produce an animated 3D scatter plot exploring "GDP per capita", "Life Expectancy", and "Population." Make the size of scatter points is proportional to the population of each country. The colors of the points should be decided by the "continent" variable. Only show "continents" in the legned. Add a reasonable title for the plot and units for the axes. What can you see from this plot?