Hi,

I do not understand why after I called apply on a function that returns an
xts (getIdvAdjSeries) it returns a matrix whose columns are just numeric
value of time series in xts instead of a list of xts objects.

Basically, I called the following:

apply(matrix(tickers,ncol=1),1,FUN=getDivAdjSeries)

getDivAdjSeries <- function(ticker) {
    seriesName <- paste(ticker,"Adjusted",sep=".");
    command <- parse(text=paste(ticker,"[,'",seriesName,"']",sep=""));
    s <- eval(command);
    dimnames(s)[[2]] <- ticker;
    command <- parse(text=paste(ticker,"@index",sep=""));
    s <- xts(s,index=eval(command));
    return(s);
}

This doesn't seem to work. Can anyone shed some light please? Thank you.

adschai

	[[alternative HTML version deleted]]


