[R] A problem on zoo object

stephen sefick ssefick at gmail.com
Sat Jul 4 16:54:18 CEST 2009


Try some reproducible example and why you want this list.  I don't
understand why you are trying to do what you want to do.

On Sat, Jul 4, 2009 at 2:51 AM, Bogaso<bogaso.christofer at gmail.com> wrote:
>
> No reply yet. Is my question not clear? Please let me know.
>
> Thanks
>
>
> Bogaso wrote:
>>
>> Thanks Gabor for this reply. However can please clarify one more thing?
>> How I want to create a list,
>> wherein each member of that list is the monthly observations. For example,
>> 1st member of list contains daily observation of 1st month, 2nd member
>> contains daily observation of 2nd month etc.
>>
>> Thanks
>>
>>
>>
>>
>> Gabor Grothendieck wrote:
>>>
>>> Try this:
>>>
>>> z <- zooreg(1:365, start = as.Date("2001-01-01"), freq = 1)
>>> f <- head
>>> tapply(seq_along(z), as.yearmon(time(z)), function(ix) f(z[ix]))
>>>
>>> where you should replace f with a function that does whatever
>>> you want with each month's data.  Here we just used head as
>>> an example.
>>>
>>>
>>> On Wed, Jul 1, 2009 at 5:17 AM, Bogaso<bogaso.christofer at gmail.com>
>>> wrote:
>>>>
>>>> I have a zoo object on daily data for 10 years. Now I want to create a
>>>> list,
>>>> wherein each member of that list is the monthly observations. For
>>>> example,
>>>> 1st member of list contains daily observation of 1st month, 2nd member
>>>> contains daily observation of 2nd month etc.
>>>>
>>>> Then for a particular month, I want to divide all observations into 3
>>>> parts
>>>> (arbitrary) and then want to calculate some statistics on each part for
>>>> each
>>>> month. Therefore for a particular month, I will have 3 means (suppose,
>>>> statistic is mean).
>>>>
>>>> Can anyone throw some light on how to do that?
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/A-problem-on-zoo-object-tp24286720p24286720.html
>>>> Sent from the R help mailing list archive at Nabble.com.
>>>>
>>>> ______________________________________________
>>>> R-help at r-project.org 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.
>>>>
>>>
>>> ______________________________________________
>>> R-help at r-project.org 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.
>>>
>>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/A-problem-on-zoo-object-tp24286720p24331752.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org 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.
>



-- 
Stephen Sefick

Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods.  We are mammals, and have not exhausted the
annoying little problems of being mammals.

								-K. Mullis




More information about the R-help mailing list