dividends Import dividends of Ford Motor Company and General Motors Company since 2015.economic data Import the U.S. Industrial Production Index since 1920.exchange rates Import exchange rate between the U.S. dollar and the South Korean Won.stock prices Import stock price of Apple, Microsoft and Facebook since 2010.filter Select Apple and Microsoft.Scatterplot Plot relationships between volume and closing price for Apple, Microsoft and Facebook, using the facet_wrap function. Add the best fit line.dividends Import dividends of Ford Motor Company and General Motors Company since 2015.## # A tibble: 41 x 3
## symbol date dividends
## <chr> <date> <dbl>
## 1 F 2015-01-28 0.15
## 2 F 2015-04-29 0.15
## 3 F 2015-07-29 0.15
## 4 F 2015-10-28 0.15
## 5 F 2016-01-27 0.4
## 6 F 2016-04-27 0.15
## 7 F 2016-07-26 0.15
## 8 F 2016-10-25 0.15
## 9 F 2017-01-18 0.2
## 10 F 2017-04-18 0.15
## # … with 31 more rows
economic data Import the U.S. Industrial Production Index since 1920.Hint: Find the symbol in FRED.
## # A tibble: 1,198 x 2
## date price
## <date> <dbl>
## 1 1920-01-01 5.79
## 2 1920-02-01 5.79
## 3 1920-03-01 5.68
## 4 1920-04-01 5.37
## 5 1920-05-01 5.51
## 6 1920-06-01 5.57
## 7 1920-07-01 5.43
## 8 1920-08-01 5.46
## 9 1920-09-01 5.26
## 10 1920-10-01 5.04
## # … with 1,188 more rows
exchange rates Import exchange rate between the U.S. dollar and the South Korean Won.Hint: Find the symbol in oanda.com.
## Warning: Oanda only provides historical data for the past 180 days. Symbol:
## USD/KRW
## # A tibble: 181 x 2
## date exchange.rate
## <date> <dbl>
## 1 2019-06-14 1185.
## 2 2019-06-15 1187.
## 3 2019-06-16 1187.
## 4 2019-06-17 1186.
## 5 2019-06-18 1181.
## 6 2019-06-19 1175.
## 7 2019-06-20 1162.
## 8 2019-06-21 1161.
## 9 2019-06-22 1159.
## 10 2019-06-23 1159.
## # … with 171 more rows
stock prices Import stock price of Apple, Microsoft and Facebook since 2010.## # A tibble: 6,910 x 8
## symbol date open high low close volume adjusted
## <chr> <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 AAPL 2010-01-04 30.5 30.6 30.3 30.6 123432400 26.6
## 2 AAPL 2010-01-05 30.7 30.8 30.5 30.6 150476200 26.6
## 3 AAPL 2010-01-06 30.6 30.7 30.1 30.1 138040000 26.2
## 4 AAPL 2010-01-07 30.2 30.3 29.9 30.1 119282800 26.2
## 5 AAPL 2010-01-08 30.0 30.3 29.9 30.3 111902700 26.3
## 6 AAPL 2010-01-11 30.4 30.4 29.8 30.0 115557400 26.1
## 7 AAPL 2010-01-12 29.9 30.0 29.5 29.7 148614900 25.8
## 8 AAPL 2010-01-13 29.7 30.1 29.2 30.1 151473000 26.2
## 9 AAPL 2010-01-14 30.0 30.1 29.9 29.9 108223500 26.0
## 10 AAPL 2010-01-15 30.1 30.2 29.4 29.4 148516900 25.6
## # … with 6,900 more rows
filter Select Apple and Microsoft.## # A tibble: 5,006 x 8
## symbol date open high low close volume adjusted
## <chr> <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 AAPL 2010-01-04 30.5 30.6 30.3 30.6 123432400 26.6
## 2 AAPL 2010-01-05 30.7 30.8 30.5 30.6 150476200 26.6
## 3 AAPL 2010-01-06 30.6 30.7 30.1 30.1 138040000 26.2
## 4 AAPL 2010-01-07 30.2 30.3 29.9 30.1 119282800 26.2
## 5 AAPL 2010-01-08 30.0 30.3 29.9 30.3 111902700 26.3
## 6 AAPL 2010-01-11 30.4 30.4 29.8 30.0 115557400 26.1
## 7 AAPL 2010-01-12 29.9 30.0 29.5 29.7 148614900 25.8
## 8 AAPL 2010-01-13 29.7 30.1 29.2 30.1 151473000 26.2
## 9 AAPL 2010-01-14 30.0 30.1 29.9 29.9 108223500 26.0
## 10 AAPL 2010-01-15 30.1 30.2 29.4 29.4 148516900 25.6
## # … with 4,996 more rows
Scatterplot Plot relationships between volume and closing price for Apple, Microsoft and Facebook, using the facet_wrap function. Add the best fit line.Hint: See the code in 4.2.1 Scatterplot
## # A tibble: 6,910 x 8
## symbol date open high low close volume adjusted
## <chr> <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 AAPL 2010-01-04 30.5 30.6 30.3 30.6 123432400 26.6
## 2 AAPL 2010-01-05 30.7 30.8 30.5 30.6 150476200 26.6
## 3 AAPL 2010-01-06 30.6 30.7 30.1 30.1 138040000 26.2
## 4 AAPL 2010-01-07 30.2 30.3 29.9 30.1 119282800 26.2
## 5 AAPL 2010-01-08 30.0 30.3 29.9 30.3 111902700 26.3
## 6 AAPL 2010-01-11 30.4 30.4 29.8 30.0 115557400 26.1
## 7 AAPL 2010-01-12 29.9 30.0 29.5 29.7 148614900 25.8
## 8 AAPL 2010-01-13 29.7 30.1 29.2 30.1 151473000 26.2
## 9 AAPL 2010-01-14 30.0 30.1 29.9 29.9 108223500 26.0
## 10 AAPL 2010-01-15 30.1 30.2 29.4 29.4 148516900 25.6
## # … with 6,900 more rows
Hint: See the scatterplot you created in the previous question.
When greater volume of stock gets sold the price increases. Both the trading volume and closing prices are negativley assoiated, the more shares sold the lower the closing price
Hint: Use message, echo and results in the chunk options. Refer to the RMarkdown Reference Guide.