# NOT RUN {
# Load libraries
library(tidyquant)
# Matrix coercion to tibble
m <- matrix(rnorm(50), ncol = 5)
colnames(m) <- c("a", "b", "c", "d", "e")
rownames(m) <- letters[1:nrow(m)]
m_tbl <- as_tibble(m, preserve_row_names = TRUE)
# xts coercion to tibble
quantmod::getSymbols("AAPL", auto.assign = FALSE) %>%
as_tibble(preserve_row_names = TRUE)
# }
Run the code above in your browser using DataLab