[R-SIG-Finance] [R-sig-finance] How to create seasonal variable for zoo object.
Bogaso
bogaso.christofer at gmail.com
Sun Jun 21 18:00:19 CEST 2009
I am really sorry to post the code "rm(list = ls())". I admit my mistake :(
Actually I wanted to create a Quarterly dummy variable for that data. I am
looking for a direct approach to create that for a zoo object.
Regards,
Gabor Grothendieck wrote:
>
> On Sun, Jun 21, 2009 at 11:42 AM, Bogaso<bogaso.christofer at gmail.com>
> wrote:
>>
>> Hi all, how to create a seasonal variable for a zoo object? For example I
>> have following dataset :
>>
>> rm(list = ls())
>
> Please don't post code like that. Someone could download it and find out
> you had wiped out their workspace.
>
>> URL <- "http://www.jmulti.de//download/datasets/e6.dat"
>> dat1 <- readLines(URL)
>> dat11 <- dat1[-c(1:11)]
>> dat12 <- read.table(textConnection(dat11))
>> library(zoo)
>> TS.dat <- zooreg(dat12[,c(2,1)], start = 1972.2, frequency = 4)
>>
>>
>> I want to create seasonal variable for each quarter for "TS.dat"
>
> Its not clear what is meant by "seasonal variable" but perhaps you
> are looking for cycle:
>
> cbind(TS.dat, cycle = cycle(TS.dat))
>
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-create-seasonal-variable-for-zoo-object.-tp24135743p24135743.html
>> Sent from the Rmetrics mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> 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.
>>
>
> _______________________________________________
> 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.
>
>
--
View this message in context: http://www.nabble.com/How-to-create-seasonal-variable-for-zoo-object.-tp24135743p24135934.html
Sent from the Rmetrics mailing list archive at Nabble.com.
More information about the R-SIG-Finance
mailing list