R/toXts.R

Defines functions toXts

Documented in toXts

toXts <- function(stock.df){
    stock.matrix <- as.matrix(stock.df[,-1]);
    colnames(stock.matrix) <- c("Open", "High", "Low", "Close", "Volume", "AdjClose")
    rownames(stock.matrix) <- as.character(stock.df$date)
    stock.xts <- as.xts(stock.matrix, descr='stock xts data')

    stock.xts
}

Try the RFinanceYJ package in your browser

Any scripts or data that you put into this service are public.

RFinanceYJ documentation built on May 2, 2019, 10:09 a.m.