Lapointe, Pierre
2005-May-16 15:38 UTC
[R] Turnpoints (pastecs): How to specify a limit on the number of tur npoints?
Hello, I'm trying to get a few turnpoints for a financial time series. There is a function in pastecs that does that. However, I get a large number of turnpoints: library(pastecs) data(EuStockMarkets) dax <-EuStockMarkets[,1] plot(dax) turnp <-turnpoints(dax) summary(turnp) #gives 925 peaks/pits!!! How can specify to get only 30 turnpoints? Second question: the extract function extract(turnp,30) gives me this:> extract(turnp,30)[1] 0 0 -1 1 0 -1 0 1 -1 0 1 0 0 -1 0 0 1 0 0 -1 0 0 0 1 -1 [26] 1 -1 1 -1 1 Warning message: arguments after the first two are ignored in: UseMethod("extract", e, n, ...)>Any odea what caused this error? I'm on win2k,> version_ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status Patched major 2 minor 1.0 year 2005 month 05 day 09 language R>Regards, Pierre Lapointe Assistant Market Strategist *********************************************************************************** AVIS DE NON-RESPONSABILITE:\ Ce document transmis par courri...{{dropped}}