[tech-spec] R-data objects

  • From: BBands <BBands@xxxxxxxxxxxxxxxxxx>
  • To: "'tech-spec@xxxxxxxxxxxxx'" <tech-spec@xxxxxxxxxxxxx>
  • Date: Mon, 11 Oct 2004 15:57:17 -0700

Version one:
getDf <- function(file) {
  Xdata <- read.csv(file, row.names=1)
  revInd <- seq(NROW(Xdata),1)
  invisible(Xdata[revInd,])
}

IBM <- getDf("ibm.csv")

Version two:

getYahoo <- function(symbol) {
    Xdata <- priceIts(instrument = symbol, start = "2004-01-01", 
    quote = c("Open", "High", "Low", "Close", "Volume", "Adj..Close."))
}

require(its)
IBM2 <- getYahoo("IBM")
names(IBM2) <- c("Open", "High", "Low", "Close", "Volume", "Adj..Close.") 

The resulting objects look the same except for the date format, but they are
different???

Data file attached.

Thanks,

    --jab



-- Binary/unsupported file stripped by Ecartis --
-- Type: application/octet-stream
-- File: IBM.csv



Other related posts: