# Load Packages
library(tidyverse) # core functions
library(tidyquant) # for financial analysis
# Import data
AAPL <- tq_get("AAPL")
Line Chart
AAPL %>%
ggplot(aes(x = date, y = close)) +
geom_line() +
labs(title = "AAPL Line Chart" , y = "Closing Price" , x = "") +
theme_tq()

Bar Chart
AAPL %>%
tail(30) %>%
ggplot(aes(x = date, y = close)) +
geom_barchart(aes(open = open, high = high, low = low, close = close)) +
labs(title = "AAPL Bar Chart" , y = "Closing Price" , x = "") +
theme_tq()

Candlestick Chart
AAPL %>%
tail(30) %>%
ggplot(aes(x = date, y = close)) +
geom_candlestick(aes(open = open, high = high, low = low, close = close)) +
labs(title = "AAPL Candlestick Chart" , y = "Closing Price" , x = "") +
theme_tq()
