Skip to content
Back to formatted view

Raw Message

Message-ID: <939D0071146E1941A5ABEB7F23C388C104B5CD38@chsa1556.share.beluni.net>
Date: 2010-09-16T09:42:27Z
From: Lüthi David (XICD 1)
Subject: How to spot lowest or Highest points from timeSeries object in Rmetrics library
In-Reply-To: <AANLkTinSFvmN_+0wGjy6FpGuL7a_RRS6QZZmLvH6NR0c@mail.gmail.com>

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"]
> class(data)
[1] "timeSeries"
attr(,"package")
[1] "timeSeries"
> min(data)
[1] 2603.37
> data[,min(data)]

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

	[[alternative HTML version deleted]]

_______________________________________________
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.