Use the given code below to answer the questions.
## Load package
library(tidyverse) # for cleaning, plotting, etc
library(tidyquant) # for financial analysis
## Import data
stocks <- tq_get("AAPL", get = "stock.prices", from = "2016-01-01")
stocks
## Visualize
stocks %>%
ggplot(aes(x = date, y = adjusted)) +
geom_line()
library(tidyverse) # for cleaning, plotting, etc
library(tidyquant) # for financial analysis
stocks <- tq_get("NFLX", get = "stock.prices", from = "2017-01-01")
stocks
One example of character data would be (“one” or “two”). Logical data is represented in a true or false scenario, such as (false, false, true, true, false)
stocks %>%
ggplot(aes(x = date, y = close)) +
geom_line()
Netflix has done well, but hit a hiccup around the middle of 2019. But overall, it grew from $250 to $400.
library(tidyverse) # for cleaning, plotting, etc
library(tidyquant) # for financial analysis
stocks <- tq_get("NFLX", "AMZN", get = "stock.prices", from = "2017-01-01")
stocks
## # A tibble: 781 x 7
## date open high low close volume adjusted
## <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 2017-01-03 125. 128. 124. 127. 9437900 127.
## 2 2017-01-04 127. 130. 127. 129. 7843600 129.
## 3 2017-01-05 129. 133. 129. 132. 10185500 132.
## 4 2017-01-06 132. 134. 130. 131. 10657900 131.
## 5 2017-01-09 131. 132. 130. 131. 5771800 131.
## 6 2017-01-10 131. 132. 129. 130. 5985800 130.
## 7 2017-01-11 131. 132. 129. 130. 5615100 130.
## 8 2017-01-12 131. 131. 128. 129. 5388900 129.
## 9 2017-01-13 131. 134. 131. 134. 10515000 134.
## 10 2017-01-17 135. 135. 132. 133. 12220200 133.
## # … with 771 more rows