#'Return an XTS Representation of a ChemTS csv File
#'
#'@param fileName A ChemTS csv file
#'@return An xts object containing the time series from the file provided as input. Assumes no header.
#'@import xts
#'@import zoo
#'@export
csvToXts <- function(fileName){
stopifnot(is.character(fileName))
aFrame = read.csv(file=fileName, header = FALSE, sep=",")
aXTS = xts(aFrame[,2], order.by = as.POSIXlt(aFrame[,1]))
return(aXTS)
}
#'Note: An xts object can easily be converted into a csv file using
#'write.zoo(xtsObject, file="<path>//<filename>.csv", sep=",")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.