Using the given code, answer the questions below.

Q1. How many columns (variables) are there?

7

Q2. What are the variables?

date, open, high, low, close, volume, adjusted

Q3. Add Microsoft stock prices, in addition to Apple.

Done

Q4. How many variables are there now? Any new variable?

8 variables, Symbol was included

Q5. On how many days either of the two stocks closed higher than $200 per share?

Hint: Use dplyr::filter. 72 days

Q6. On how many days Apple stock closed higher than $200 per share?

Hint: Use dplyr::filter. 72 Days

Q7. Create a new variable, MC, market capitalization.

Hint: Use dplyr::mutate. Market cap is given by the formula, MC = N × P, where MC is the market capitalization, N is the number of shares outstanding, and P is the closing price per share. Done

Q8. Keep only three variables symbol, date, close and market capitalization and drop the other variables.

Hint: Use dplyr::select. Done

Q9 Plot daily closing stock prices for both stocks by mapping symbol to color.

Hint: Use ggplot2::ggplot.