Skip to content
Prev 6670 / 15274 Next

How to spot lowest or Highest points from timeSeries object in Rmetrics library

Hi Josh
To get the date of the minimum observation: time(data)[which.min(data)]
To get the data as timeSeries: data[which.min(data), drop = FALSE] 
Best,
david

-----Original Message-----
From: r-sig-finance-bounces at stat.math.ethz.ch [mailto:r-sig-finance-bounces at stat.math.ethz.ch] On Behalf Of JOSH C. CHIEN
Sent: Thursday, September 16, 2010 11:32 AM
To: r-sig-finance at stat.math.ethz.ch
Subject: [R-SIG-Finance] How to spot lowest or Highest points from timeSeries object in Rmetrics library

Hi all,
In my case, I just want to know what date is the lowest point in time
series.

Library(fPortfolio)
data(SWX)
data <- SWX[,"SPI"]
[1] "timeSeries"
attr(,"package")
[1] "timeSeries"
[1] 2603.37
It's not work for what I want.

I have ever tried "order" function. It's also not work.

how to get the data date for 2603.37 from this case ?

thank a lot.

Josh


_______________________________________________
R-SIG-Finance at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.