i using weatherdata
package, specifically, getdetailedweather
function. returns data frame, 1 of component of data frame time
, of class posixct
. problem time
comes set local timezone of machine using. pretty sure incorrect, data reflects local time, , thing api add timezone data, without changing it. correct? how can tell api stop using timezone default?
e.g.:
library(weatherdata) dat <- getdetailedweather("nrt", "2014-04-29") dat$time # [1] "2014-04-29 00:00:00 est" ## local timezone, not of weather station
looking @ results of example in ?getdetailedweather
:
library(weatherdata) dat <- getdetailedweather("nrt", "2014-04-29") dat$time # [1] "2014-04-29 00:00:00 est" "2014-04-29 00:30:00 est" "2014-04-29 01:00:00 est" etc
the returned times seem 'correct', in goes 00:00 23:30. timezone data not of weather station though, rather of host computer system. may best off changing output data once have it, r present date/time posixct
objects in local timezone default, e.g.:
as.posixct(as.character(dat$time),tz="utc") # [1] "2014-04-29 00:00:00 utc" "2014-04-29 00:30:00 utc" "2014-04-29 01:00:00 utc" etc
the above changes timezone new timezone (in case "utc"
, use 1 appropriate weather station location) without affecting time of day data. see here: valid time zones in lubridate identifying local timezone codes.