View source: R/data_adapters.R
| sql_adapter_adjusted | R Documentation |
Loads adjusted stock prices (for splits/dividends) from SQLite.
sql_adapter_adjusted(
db_path,
symbols,
start_date = NULL,
end_date = NULL,
auto_update = FALSE,
frequency = "daily",
use_adjusted = TRUE
)
db_path |
Path to SQLite database file |
symbols |
Character vector of stock symbols to load |
start_date |
Start date (YYYY-MM-DD) or NULL |
end_date |
End date (YYYY-MM-DD) or NULL |
auto_update |
Auto-update database (default: FALSE) |
frequency |
"daily", "weekly", or "monthly" (default: "daily") |
use_adjusted |
Use adjusted prices if available (default: TRUE) |
data.table with Date column and adjusted prices per symbol
prices <- sql_adapter_adjusted(
db_path = "sp500.db",
symbols = c("AAPL", "MSFT"),
start_date = "2020-01-01",
end_date = "2020-12-31",
frequency = "monthly"
)
head(prices)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.