Hi R users,

could anyone guide me in the right direction reg. the column-wise 
application of a function on a zoo dataframe.

The tseries function sharpe() can only be applied to a univariate time 
series. Suppose you have merged the returns of two assets with 
get.hist.quote(), i.e.

set <- merge(log(ibm), log(ge))

is it possible to apply the function sharpe(), in this case with the 
argument

scale=sqrt(52)

since I am using weekly close prices

to the dataset "set" column per column?

I tried apply() with no result:

 > apply(set, 2, sharpe(set, scale=sqrt(52)))
Fehler in sharpe(zz) : x is not a vector or univariate time series

In the case of two securities, I could easily do it by hand, but for say 
100 or even 500, I am looking for an automated solution.


Many thanks in advance!

Bernd

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to