[R-SIG-Finance] Data frame
Brian G. Peterson
brian at braverock.com
Mon May 27 21:53:17 CEST 2013
On 05/27/2013 01:18 PM, towanda.sagitario wrote:
> Tengo datos de activos financieros en xls que exporto convenientemente a r
> . En cada columna tengo una series de datos numericos (precios de cierres)
> de los activos financieros. Como podria tipificar cada uno de esos valores
> numericos segun media y desviacion tipica segun la muestra tomada? Gracias
This list is usually in English.
It's a little difficult for me to understand what you're asking for.
If you have a time series of prices, you should probably use a time
series class such as xts rather than a data.frame.
If you want the mean and sd for the entire series, then mean() and sd()
will work. If you want a running estimate over some time window or
sample, then you probably want runMean() and runSD()
require(quantmod)
getSymbols('IBM')
IBM$runMean<-runMean(Cl(IBM),20)
IBM$runSD<-runSD(Cl(IBM),20)
mean(Cl(IBM))
sd(Cl(IBM))
Regards,
Brian
--
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock
More information about the R-SIG-Finance
mailing list