This is an R Markdown Notebook. When you execute code within the notebook, the results appear beneath the code.
Try executing this chunk by clicking the Run button within the chunk or by placing your cursor inside it and pressing Ctrl+Shift+Enter.
Jpn.Kor.ETF <- c("EWJ","EWY") %>%
tq_get("stock.prices", from = "2019-01-01", to = "2022-09-30") %>%
group_by(symbol) %>%
tq_transmute(select = adjusted,
mutate_fun = periodReturn,
period = "monthly",
col_rename = "Returns")
Jpn.Kor.ETF %>%
ggplot(aes(x=date, y=Returns, color = symbol))+
geom_line()+
scale_x_date(date_labels = "%Y", date_breaks = "1 year") +
labs(
x = "Date",
y = "Adjusted Returns",
title = "ETF Trend in Japan and Korea from 2019 to 2022",
subtitle = "Comparison of changes in adjusted returns on ETF in two major developed economies in East Asia",
caption = "Data Source: TidyQuant",
color = "" ) +
theme_pander()