Use the given code below to answer the questions.
Hint: Insert a new code chunk below and type in the code, using the tq_get() function above. Replace the ticker symbol for Microsoft. You may find the ticker symbol for Microsoft from Yahoo Finance.
{r}stocks <- tq_get("MSFT", get = "stock.prices", from = "2016-01-01") stocks
Hint: Insert a new code chunk below and type in the code, using the glimpse() function above.
glimpse(stocks)
## Observations: 922
## Variables: 7
## $ date <date> 2016-01-04, 2016-01-05, 2016-01-06, 2016-01-07, 2016-0…
## $ open <dbl> 54.32, 54.93, 54.32, 52.70, 52.37, 52.51, 52.76, 53.80,…
## $ high <dbl> 54.80, 55.39, 54.40, 53.49, 53.28, 52.85, 53.10, 54.07,…
## $ low <dbl> 53.39, 54.54, 53.64, 52.07, 52.15, 51.46, 52.06, 51.30,…
## $ close <dbl> 54.80, 55.05, 54.05, 52.17, 52.33, 52.30, 52.78, 51.64,…
## $ volume <dbl> 53778000, 34079700, 39518900, 56564900, 48754000, 36943…
## $ adjusted <dbl> 50.70846, 50.93979, 50.01446, 48.27483, 48.42288, 48.39…
Hint: Watch the video, “Basic Data Types”, in DataCamp: Introduction to R for Finance: Ch1 The Basics.
Hint: Insert a new code chunk below and type in the code, using the ggplot() function above. For more information on the ggplot() function, refer to Ch2 Introduction to ggplot2 in one of our e-textbooks, Data Visualization with R.
Hint: Change message, warning, collapse, echo and results in the chunk options. Refer to the RMarkdown Reference Guide.