Pass an Earth Engine date object to R
eedate_to_rdate(ee_date, timestamp = FALSE)
Arguments
ee$date object (ee$Date)
Logical. If TRUE, return the date in milliseconds from the Unix Epoch (1970-01-01 00:00:00 UTC). Otherwise, return the date as a POSIXct object. By default FALSE.
eedate_to_rdate
will return either a numeric timestamp or a POSIXct object depending on the timestamp
argument.
eedate_to_rdate
is essential to avoid potential errors that might appear when users need to retrieve dates. Currently, R integer only supports 32 bit signed (such integers can only count up to about 2 billion). This range is notably insufficient for dealing with GEE date objects represented by timestamps in milliseconds since the UNIX epoch. eedate_to_rdate
uses Python in the backend to obtain the date and convert it in float before exporting to R.
if (FALSE) { # \dontrun{
library(rgee)
ee_Initialize()
eeDate <- ee$Date$fromYMD(2010,1,1)
eedate_to_rdate(eeDate,timestamp = TRUE) # good
eeDate$getInfo()$value # bad
} # }
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4