as.xts.data.frame <- function(
data,
index
) {
index_values <-
data %>%
dplyr::pull({{ index }})
data %>%
dplyr::select(! {{ index }}) %>%
xts::xts(order.by = index_values) %>%
return()
}
as_tibble.xts <- function(
data,
index
) {
data %>%
zoo::fortify.zoo() %>%
tibble::as_tibble() %>%
dplyr::rename(index = .data$Index) %>%
return()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.