stock prices
Import stock price of Facebook since 2010.dividends
Import dividends of Apple and Microsoft since 2010.exchange rates
Import exchange rate between the U.S. dollar and the Japanese yen.stock prices
Import stock price of Facebook since 2010.## # A tibble: 1,853 x 7
## date open high low close volume adjusted
## <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 2012-05-18 42.0 45 38 38.2 573576400 38.2
## 2 2012-05-21 36.5 36.7 33 34.0 168192700 34.0
## 3 2012-05-22 32.6 33.6 30.9 31 101786600 31
## 4 2012-05-23 31.4 32.5 31.4 32 73600000 32
## 5 2012-05-24 33.0 33.2 31.8 33.0 50237200 33.0
## 6 2012-05-25 32.9 33.0 31.1 31.9 37149800 31.9
## 7 2012-05-29 31.5 31.7 28.6 28.8 78063400 28.8
## 8 2012-05-30 28.7 29.5 27.9 28.2 57267900 28.2
## 9 2012-05-31 28.5 29.7 26.8 29.6 111639200 29.6
## 10 2012-06-01 28.9 29.2 27.4 27.7 41855500 27.7
## # … with 1,843 more rows
dividends
Import dividends of Apple and Microsoft since 2010.## # A tibble: 68 x 3
## symbol date dividends
## <chr> <date> <dbl>
## 1 AAPL 2012-08-09 0.0541
## 2 AAPL 2012-11-07 0.0541
## 3 AAPL 2013-02-07 0.0541
## 4 AAPL 2013-05-09 0.0622
## 5 AAPL 2013-08-08 0.0622
## 6 AAPL 2013-11-06 0.0622
## 7 AAPL 2014-02-06 0.0622
## 8 AAPL 2014-05-08 0.0671
## 9 AAPL 2014-08-07 0.47
## 10 AAPL 2014-11-06 0.47
## # … with 58 more rows
Hint: See the code in 4.2.2 Line plot in the textbook.
Hint: See the code in 4.2.2 Line plot in the textbook.
Since 2014, Apple’s dividends has gone a lot. It went up a lot in 2014, and after 2014 it has steadly gone up. ## Q6. economic data
Import U.S. civilian unemployment rate (seasonally adjusted). Hint: Find the symbol in FRED.
## # A tibble: 116 x 2
## date price
## <date> <dbl>
## 1 2010-01-01 9.8
## 2 2010-02-01 9.8
## 3 2010-03-01 9.9
## 4 2010-04-01 9.9
## 5 2010-05-01 9.6
## 6 2010-06-01 9.4
## 7 2010-07-01 9.4
## 8 2010-08-01 9.5
## 9 2010-09-01 9.5
## 10 2010-10-01 9.4
## # … with 106 more rows
exchange rates
Import exchange rate between the U.S. dollar and the Japanese yen.Hint: Find the symbol in oanda.com.
## Warning: Oanda only provides historical data for the past 180 days. Symbol:
## USD/JPY
## # A tibble: 180 x 2
## date exchange.rate
## <date> <dbl>
## 1 2019-04-04 111.
## 2 2019-04-05 112.
## 3 2019-04-06 112.
## 4 2019-04-07 112.
## 5 2019-04-08 111.
## 6 2019-04-09 111.
## 7 2019-04-10 111.
## 8 2019-04-11 111.
## 9 2019-04-12 112.
## 10 2019-04-13 112.
## # … with 170 more rows
Hint: Use message
, echo
and results
in the chunk options. Refer to the RMarkdown Reference Guide.