edzer / spacetime

Classes and methods for spatio-temporal data
74 stars 20 forks source link

Replace direct access to tzone attribute #38

Closed joshuaulrich closed 5 years ago

joshuaulrich commented 5 years ago

It's best to access object attributes using provided methods, instead of calling attr(x, 'foo'). So xts::indexTZ() should have been used.

The tzone attribute is being removed from the xts object after xts version 0.11-2, and will only be attached to the index. indexTZ() is also deprecated and replaced by tzone(), so we shouldn't use indexTZ().

Add a tzone() function that will handle tzone attributes for xts and POSIXct objects. The xts index had a tzone attribute in xts version 0.8-8, so get the index attribute for xts objects, and the tzone attribute for POSIXct (or any other) object. Use xts::tzone() if the loaded xts version is greater than 0.11-2.

See joshuaulrich/xts#245 for details.

Fixes #37.

edzer commented 5 years ago

Great, thank you so much!

joshuaulrich commented 4 years ago

Hi Edzer, I need to release the version of xts that triggers this error. This will cause a CRAN check failure in geoSpectral. Can you please prepare a spacetime release in the near future?

edzer commented 4 years ago

Done, now; thanks!

joshuaulrich commented 4 years ago

Thank you! I saw {spacetime} in incoming/ when I submitted {xts}, so thanks for getting it to CRAN quickly!