Re: [R] extract certain values from a ts

From: antonio rodriguez <antonio.raju_at_gmail.com>
Date: Tue 24 Oct 2006 - 19:10:20 GMT

Leeds, Mark (IED) escribió:
> zoo is pretty neat. If you have time, print out the zoo documentation. There are some useful function described.
>

It seems to be pretty useful for my specific task at this moment. I should take a look on it

Antonio

>
> -----Original Message-----
> From: antonio rodriguez [mailto:antonio.raju@gmail.com]
> Sent: Tuesday, October 24, 2006 3:01 PM
> To: Leeds, Mark (IED); R-Help
> Subject: Re: [R] extract certain values from a ts
>
> Leeds, Mark (IED) escribió:
>
>> maybe subset works. I'm not familiar with that.
>>
>>
>
> neither me
>
>
>> -----Original Message-----
>> From: antonio rodriguez [mailto:antonio.raju@gmail.com]
>> Sent: Tuesday, October 24, 2006 2:49 PM
>> To: Leeds, Mark (IED); R-Help
>> Subject: Re: [R] extract certain values from a ts
>>
>> Leeds, Mark (IED) escribió:
>>
>>
>>> take your ts object and convert it to a zoo object ( you need to have
>>> the zoo package and chron which it depends on installed) using
>>>
>>> WS<-as.zoo(WS).
>>>
>>> Then , use the command the I gave you earlier. I think that should retain the dates.
>>> If that doesn't work, ask Gabor because he can tell you for sure.
>>>
>>> In general, keeping things as zoo objects allows you to retain date info quite nicely.
>>>
>>>
>>>
>> You are right! Yes it keeps the year and the day. Luckily zoo is free
>> :-))
>>
>> Best regards!!
>>
>> Antonio
>>
>>
>>
>>
>>> If zoo weren't free, I could work as a salesman for Gabor.
>>>
>>>
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: antonio rodriguez [mailto:antonio.raju@gmail.com]
>>> Sent: Tuesday, October 24, 2006 2:22 PM
>>> To: Leeds, Mark (IED); R-Help
>>> Subject: Re: [R] extract certain values from a ts
>>>
>>> Leeds, Mark (IED) escribió:
>>>
>>>
>>>
>>>> I don't think it matters whether it's a ts or a vector.
>>>>
>>>> WS<-WS[ ( WS > 5 ) & ( WS < 8 ) ]
>>>>
>>>> Check to make sure it works.
>>>>
>>>>
>>>>
>>>>
>>> Dear Mark,
>>>
>>> Yes it works. But I think that it matters for a ts since I want to know the days when those values where observed. The above solution gives me the number of days when those values were observed but not the days when they were observed. It is important to me to know if, for example, in april 1999, I had 3 periods with winds blowing below 8 m/s and over 5 m/s.
>>>
>>> Best regards!
>>>
>>> Antonio
>>>
>>>
>>>
>>>
>>>
>>>> -----Original Message-----
>>>> From: r-help-bounces@stat.math.ethz.ch
>>>> [mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of antonio
>>>> rodriguez
>>>> Sent: Tuesday, October 24, 2006 1:57 PM
>>>> To: r-help@stat.math.ethz.ch
>>>> Subject: [R] extract certain values from a ts
>>>>
>>>> Hi,
>>>>
>>>> Having several daily wind speed time series I want to extract those
>>>> consecutive days over and below certain values (i.e. 5 < x <8) Don't
>>>> know which funtion to use (aggregate, lapply?) and how to do it.
>>>>
>>>> Thanks in advance
>>>>
>>>> Antonio
>>>>
>>>> ______________________________________________
>>>> R-help@stat.math.ethz.ch 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.
>>>> --------------------------------------------------------
>>>>
>>>> This is not an offer (or solicitation of an offer) to buy/sell the securities/instruments mentioned or an official confirmation. Morgan Stanley may deal as principal in or own or act as market maker for securities/instruments mentioned or may advise the issuers. This is not research and is not from MS Research but it may refer to a research analyst/research report. Unless indicated, these views are the author's and may differ from those of Morgan Stanley research or others in the Firm. We do not represent this is accurate or complete and we may not update this. Past performance is not indicative of future returns. For additional information, research reports and important disclosures, contact me or see https://secure.ms.com/servlet/cls. You should not use e-mail to request, authorize or effect the purchase or sale of any security or instrument, to send transfer instructions, or to effect any other transactions. We cannot guarantee that any such requests received via e-mail will be processed in a timely manner. This communication is solely for the addressee(s) and may contain confidential information. We do not waive confidentiality by mistransmission. Contact me if you do not wish to receive these communications. In the UK, this communication is directed in the UK to those persons who are market counterparties or intermediate customers (as defined in the UK Financial Services Authority's rules).
>>>>
>>>>
>>>>
>>>>
>>>>
>>> --------------------------------------------------------
>>>
>>> This is not an offer (or solicitation of an offer) to buy/sell the securities/instruments mentioned or an official confirmation. Morgan Stanley may deal as principal in or own or act as market maker for securities/instruments mentioned or may advise the issuers. This is not research and is not from MS Research but it may refer to a research analyst/research report. Unless indicated, these views are the author's and may differ from those of Morgan Stanley research or others in the Firm. We do not represent this is accurate or complete and we may not update this. Past performance is not indicative of future returns. For additional information, research reports and important disclosures, contact me or see https://secure.ms.com/servlet/cls. You should not use e-mail to request, authorize or effect the purchase or sale of any security or instrument, to send transfer instructions, or to effect any other transactions. We cannot guarantee that any such requests received via e-mail will be processed in a timely manner. This communication is solely for the addressee(s) and may contain confidential information. We do not waive confidentiality by mistransmission. Contact me if you do not wish to receive these communications. In the UK, this communication is directed in the UK to those persons who are market counterparties or intermediate customers (as defined in the UK Financial Services Authority's rules).
>>>
>>>
>>>
>>>
>> --------------------------------------------------------
>>
>> This is not an offer (or solicitation of an offer) to buy/sell the securities/instruments mentioned or an official confirmation. Morgan Stanley may deal as principal in or own or act as market maker for securities/instruments mentioned or may advise the issuers. This is not research and is not from MS Research but it may refer to a research analyst/research report. Unless indicated, these views are the author's and may differ from those of Morgan Stanley research or others in the Firm. We do not represent this is accurate or complete and we may not update this. Past performance is not indicative of future returns. For additional information, research reports and important disclosures, contact me or see https://secure.ms.com/servlet/cls. You should not use e-mail to request, authorize or effect the purchase or sale of any security or instrument, to send transfer instructions, or to effect any other transactions. We cannot guarantee that any such requests received via e-mail will be processed in a timely manner. This communication is solely for the addressee(s) and may contain confidential information. We do not waive confidentiality by mistransmission. Contact me if you do not wish to receive these communications. In the UK, this communication is directed in the UK to those persons who are market counterparties or intermediate customers (as defined in the UK Financial Services Authority's rules).
>>
>>
>>
> --------------------------------------------------------
>
> This is not an offer (or solicitation of an offer) to buy/sell the securities/instruments mentioned or an official confirmation. Morgan Stanley may deal as principal in or own or act as market maker for securities/instruments mentioned or may advise the issuers. This is not research and is not from MS Research but it may refer to a research analyst/research report. Unless indicated, these views are the author's and may differ from those of Morgan Stanley research or others in the Firm. We do not represent this is accurate or complete and we may not update this. Past performance is not indicative of future returns. For additional information, research reports and important disclosures, contact me or see https://secure.ms.com/servlet/cls. You should not use e-mail to request, authorize or effect the purchase or sale of any security or instrument, to send transfer instructions, or to effect any other transactions. We cannot guarantee that any such requests received via e-mail will be processed in a timely manner. This communication is solely for the addressee(s) and may contain confidential information. We do not waive confidentiality by mistransmission. Contact me if you do not wish to receive these communications. In the UK, this communication is directed in the UK to those persons who are market counterparties or intermediate customers (as defined in the UK Financial Services Authority's rules).
>
>



R-help@stat.math.ethz.ch 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. Received on Wed Oct 25 05:23:40 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 24 Oct 2006 - 20:30:35 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.