I keep getting this warning: timezone of object (UTC) is different than current timezone ().
My current timezone is "EET", as shown by Sys.timezone()
.
Is there a way to change the R timezone to UTC, instead of it taking the one from my system? Or to disable the warning?
Try this:
Sys.setenv(TZ = "UTC")
If there is provision for getting a local timezone it is from:
Sys.timezone()
[1] "" # So in my case nothing there
And there is no Sys.timezone()<- function
Sys.time()
[1] "2011-01-06 16:01:10 EST"
But obviously something is to be had. And here is how to convert to another time zone:
strftime(Sys.time() , tz="UTC")
[1] "2011-01-06 21:02:48"
For further specific advice perhaps if you offered the results of dput() on the object, we would all have access to any necessary attributes to answer further questions.
If you are sure that your code works and other sources of warnings are not likely, then just put the call inside suppressWarnings().
For example,
require(quantmod)
getSymbols("FDX")
suppressWarnings(chartSeries(FDX,theme="white"))
If you work with xts data type (let's call the xts object xts.ts) from the package xts you can use:
tzone(xts.ts) <- "America/Phoenix"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With