.datatable.aware = TRUE
if (getRversion() >= '2.15.1')
utils::globalVariables(c('.', 'Date', 'out'), utils::packageName())
#' @title get_start_dates
#' @description Shows the start dates of all OHLCV series in the 'prices' directory.
#' @return A data table containing a symbol in one column, and the start date of its OHLCV series in the other.
#' @export
#' @importFrom zoo index
#' @importFrom utils head
#' @importFrom data.table data.table
get_start_dates <- function()
{
lapply(list.files('prices'), function(x) {
ohlcv <- readRDS(file.path('prices', x))
date <- ohlcv %>% zoo::index(out) %>% utils::head(1)
name <- names(ohlcv)[1] %>% sub(pattern='.Open', replacement='')
data.table::data.table(name, date)
}) %>%
do.call(what = rbind) %>%
`names<-`(c('Symbol', 'Date')) %>%
.[order(Date)]
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.