Dear R-users,
I tried to read recorded data into R, but confronted the problem about
time zone. The data was recorded in GMT+1 (without summer time
changing), and at first I tried to do in the way:
data <- read.zoo("data.txt", header=FALSE, sep=",",
format="%H:%M:%S
%d.%m.%Y", strip.white=TRUE, tz="GMT+1", skip=3)
However, it failed. Then, I found the description of "Time Zones" in R
help and noticed the Olson database is stored in the specific folder
under Windows OS which is the OS I'm working on. I noticed there is no
file related to GMT+1 time zone if I understood correctly. So far my
workaround is to set the tz to Africa/Lagos where is the city in
Africa sharing the same time zone. However, it's a little bit weird
because the data was not collected in that city nor the place near by.
My question is that if there is other way to set the tz to GMT+1
instead using my workaround to have a neutral meaning in my script?
Regards,
Keith
Keith, If you are working within a single time zone, including time zone information with each record does not seem necessary and you probably are not recording times to the sub-second. The best solution may thus be to use a simpler date/time class that does not include time zone information. You should consider the "chron" package and see R News 4/1 for helpful hints. "chron" makes construction and use of date/time records very easy:> library(chron) > dt <- c("10/20/2009") > tm <- c("11:02:00") > chron(dt,tm)[1] (10/20/09 11:02:00) Good luck! Glen Keith-119 wrote:> > > My question is that if there is other way to set the tz to GMT+1 > instead using my workaround to have a neutral meaning in my script? > > >-- View this message in context: http://www.nabble.com/Time-Zone-names-on-Windows-tp25977196p25977926.html Sent from the R help mailing list archive at Nabble.com.
Dear R-users,
I have two regular hourly time series data which were recorded in time
zone GMT+1, and now I would like to merge them together for further
analyses. Here I used zoo and merge.zoo for my purposes and everything
worked fine except the timestamp shifted 2 hours after merging which
bugs me a little bit. Here is the example:
data01
00:00:00 01.01.2007, 8.0250
01:00:00 01.01.2007, 8.0167
02:00:00 01.01.2007, 10.0917
03:00:00 01.01.2007, 8.6750
04:00:00 01.01.2007, 6.3250
data02
00:00:00 01.01.2007, 257.58
01:00:00 01.01.2007, 239.92
02:00:00 01.01.2007, 234.00
03:00:00 01.01.2007, 220.00
04:00:00 01.01.2007, 206.92
which are both read into zoo object, data01 and data02, separately by
setting tz = "GMT+1". However, while merging function is operated, the
result is
merge.zoo(data01, data02)
data01 data02
2007-01-01 02:00:00 8.0250 257.58
2007-01-01 03:00:00 8.0167 239.92
2007-01-01 04:00:00 10.0917 234.00
2007-01-01 05:00:00 8.6750 220.00
2007-01-01 06:00:00 6.3250 206.92
which is 2 hours shifted comparing to the original data. I am wondering
if it's the problem of tz parameter. Hence, I re-read the data by
setting tz = "GMT", and the merging result is
merge.zoo(data01, data02)
data01 data02
2007-01-01 01:00:00 8.0250 257.58
2007-01-01 02:00:00 8.0167 239.92
2007-01-01 03:00:00 10.0917 234.00
2007-01-01 04:00:00 8.6750 220.00
2007-01-01 05:00:00 6.3250 206.92
which is 1 hour shifted. I only noticed this but don't know why and how
to fix it. Does anyone have idea about this issue?
Best regards,
Keith