In this exercise you will learn to plot data using the ggplot2 package. To answer the questions below, use Chapter 4.3 Categorical vs. Quantitative Data Visualization with R.
Hint: See the code in 4.3.2 Grouped kernel density plots.
Hint: See the code in 4.3.3 Box plots. Use the same title as in the density plot.
Hint: Discuss your answer based on median, the middle 50%, roughly 99% of the data, and outliers.
Based on the boxplot, I would be more likely to invest in MSFT because there is one less outlier than in AAPL, showing that MSFT has less extreme losses, and also because the median on daily return of stock is higher than AAPL. Positive gain is more frequent in MSFT, therefore showing that MSFT performed better than AAPL thus far in 2020.
Hint: See the code in 4.3.1 Bar chart (on summary statistics).
Hint: See the code in 4.3.1 Bar chart (on summary statistics).
Hint: See the code in 4.3.1 Bar chart (on summary statistics).
Hint: See the code in 4.3.1 Bar chart (on summary statistics).
Hint: Use message, echo and results in the chunk options. Refer to the RMarkdown Reference Guide.