[R-SIG-Finance] Quantmod Monthly Return function

Jeff Ryan jeff.a.ryan at gmail.com
Mon Sep 20 23:36:03 CEST 2010


Even though "XP" is the obvious answer to most TZ issues, can you also
pass along:

Sys.getenv("TZ")  AND Sys.timezone()

Ideally (only??) should be set to:  Europe/Amsterdam, i.e.
Sys.setenv(TZ="Europe/Amsterdam")

Thanks,
Jeff

On Mon, Sep 20, 2010 at 4:26 PM, Werner Erselina <w.erselina at gmail.com> wrote:
> Hy Jan and Jeff,
> Hereby the output for the sessioninfo:
>> sessionInfo()
> R version 2.11.1 (2010-05-31)
> i386-pc-mingw32
> locale:
> [1] LC_COLLATE=Dutch_Netherlands.1252  LC_CTYPE=Dutch_Netherlands.1252
> [3] LC_MONETARY=Dutch_Netherlands.1252 LC_NUMERIC=C
> [5] LC_TIME=Dutch_Netherlands.1252
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
> other attached packages:
> [1] quantmod_0.3-14            Defaults_1.1-1
> [3] PerformanceAnalytics_1.0.3 xts_0.7-4
> [5] zoo_1.6-4
> loaded via a namespace (and not attached):
> [1] grid_2.11.1    lattice_0.18-8 tools_2.11.1   TTR_0.20-2
> Working on windows XP
> Greetings,
> Werner
> 2010/9/20 Jeff Ryan <jeff.a.ryan at gmail.com>
>>
>> Hi Werner,
>>
>> It actually is far more subtle an issue than quantmod.  It is
>> essentially how your TZ and Locale is getting used/abused by your OS.
>>
>> Can you provide at least the output of sessionInfo so we may get a
>> better idea of what is happening?
>>
>> Thanks
>> Jeff
>>
>> On Mon, Sep 20, 2010 at 4:00 PM, Jan Vandermeer <nordicgnome at gmail.com>
>> wrote:
>> > Hi Werner;
>> >
>> > quantmod 0.3-8 running under Gentoo x86_64 and R-2.11.1 provides:
>> >
>> >
>> > library(quantmod)
>> > Loading required package: xts
>> > Loading required package: zoo
>> > Loading required package: Defaults
>> > Loading required package: TTR
>> > getSymbols("^AEX", from ="1999-01-01")
>> > [1] "AEX"
>> > head(monthlyReturn(AEX))
>> >         monthly.returns
>> > Jan 1999    -0.024654471
>> > Feb 1999     0.007573907
>> > Mar 1999     0.001510856
>> > Apr 1999     0.068146686
>> > May 1999    -0.033930813
>> > Jun 1999     0.012868642
>> >
>> > Jan
>> >
>> > On Mon, Sep 20, 2010 at 4:35 PM, Werner Erselina
>> > <w.erselina at gmail.com>wrote:
>> >
>> >> Dear R-finance list,
>> >>
>> >> Why is the Monthly Return function from the Quantmod packge showing a
>> >> return
>> >> for the month december 1998. When my data begins at 1999-01-04
>> >> (YYYY-MM-DD)
>> >>
>> >> > getSymbols("^AEX", from ="1999-01-01")
>> >> [1] "AEX"
>> >> > head(monthlyReturn(AEX))
>> >>         monthly.returns
>> >> dec 1998    -0.024654471
>> >> jan 1999     0.007573907
>> >> feb 1999     0.001510856
>> >> mrt 1999     0.068146686
>> >> apr 1999    -0.033930813
>> >> mei 1999     0.012868642
>> >>
>> >> Greetings,
>> >>
>> >> Werner
>> >>
>> >>        [[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.
>> >>
>> >
>> >        [[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.
>> >
>>
>>
>>
>> --
>> Jeffrey Ryan
>> jeff.a.ryan at gmail.com
>
>



-- 
Jeffrey Ryan
jeff.a.ryan at gmail.com



More information about the R-SIG-Finance mailing list