Q1. dividends Import dividends of Apple and Microsoft since 2010.

## Warning: x = 'AAPL', get = 'dividends': Error in vapply(parse(text = fr[, 2]), eval, numeric(1)): values must be length 1,
##  but FUN(X[[1]]) result is length 2
##  Removing AAPL.
## Warning: x = 'MSFT', get = 'dividends': Error in vapply(parse(text = fr[, 2]), eval, numeric(1)): values must be length 1,
##  but FUN(X[[1]]) result is length 2
##  Removing MSFT.
## # A tibble: 0 x 2
## # … with 2 variables: symbol <chr>, dividends <???>

Q2. economic data Import U.S. civilian unemployment rate (seasonally adjusted) since 2017.

## # A tibble: 38 x 2
##    date       price
##    <date>     <dbl>
##  1 2017-01-01   4.7
##  2 2017-02-01   4.6
##  3 2017-03-01   4.4
##  4 2017-04-01   4.4
##  5 2017-05-01   4.4
##  6 2017-06-01   4.3
##  7 2017-07-01   4.3
##  8 2017-08-01   4.4
##  9 2017-09-01   4.2
## 10 2017-10-01   4.1
## # … with 28 more rows

Q3. exchange rates Import exchange rate between the U.S. dollar and the Japanese yen.

## 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-09-26          108.
##  2 2019-09-27          108.
##  3 2019-09-28          108.
##  4 2019-09-29          108.
##  5 2019-09-30          108.
##  6 2019-10-01          108.
##  7 2019-10-02          107.
##  8 2019-10-03          107.
##  9 2019-10-04          107.
## 10 2019-10-05          107.
## # … with 170 more rows

Q4. stock prices Import stock price of Apple and Microsoft since 2010.

## # A tibble: 5,144 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.5
##  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.1
##  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.1
##  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.5
## # … with 5,134 more rows

Q5 Scatterplot Plot the relationship between closing price and volume for Apple.

Q6 Describe the relationship between closing price and volume for Apple.

The closing price of Apple is higher as volume is lower.

Q7 Scatterplot Plot the relationship between closing price and volume for both Apple and Microsoft.