knitr::opts_chunk$set(
    echo    = as.logical(params$show_code),
    message = FALSE, 
    warning = FALSE
)
library(tidyquant)
library(dplyr)
library(knitr)

This report contains market data for r params$symbols. To make for something to plot, I suggest you pull 7 days worth of data.

# Get data
stock_data_tbl <- tq_get(
        x    = params$symbols,
        from = today()-7, 
        to   = today()
    ) %>%
    select(symbol, date, adjusted)

kable(stock_data_tbl,caption="Last 7 days of market close")
# Create plot with gain/loss
## you to do
# save data 
# do you want to have a single running RDS file, or a file for every time this runs
# up to you to decide


sarahc21vt/HW6 documentation built on July 22, 2024, 8:12 p.m.