edzer / trajectories

Handling and analyzing trajectory and movement data
31 stars 15 forks source link

cannot reproduce import of data(A3) #21

Closed bastistician closed 6 years ago

bastistician commented 6 years ago
example(A3, run.dontrun = TRUE)

currently fails from https://github.com/edzer/trajectories/blob/921bc590b2b8fda7a6143b3ab93eb6c91fe64873/man/A3.Rd#L24 for two reasons:

  1. The % characters need to be escaped (%%) to survive Rd rendering.
  2. I get "2013/11/15 06:35:33+00" as the first entry of spdf$time, which thus leads to an all NA vector time. This is confusing since I do see the described format when looking at the getURL() response, e.g., substr(url, 1269, 1297) gives "\"time\":\"2013-11-15T06:35:39Z\"". The conversion seems to happen during readOGR() and may be locale-dependent (I am on de_DE.UTF-8).
edzer commented 6 years ago

Thanks! I think I am going to move this to a demo script, like demo(A3), instead of having it in a don't run block; it's' going to break anyway again soon because of external reasons. The syntax is correct, R just messes it up for reasons unclear to me. The time format of the web service changed once more; now you can read it with

time = as.POSIXct(paste0(as.character(spdf$time),"00"), format = "%Y/%m/%d %H:%M:%S%z")

sigh...