~hrbrmstr/daybreak

ref: af8ff3a5efbe1173d1a188e6d8d884c2bc809e9c daybreak/R/validators.R -rw-r--r-- 237 bytes
af8ff3a5hrbrmstr plain C version 1 year, 8 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
valid_date <- function(date) {
  as.POSIXlt(date[1])
}

valid_lon <- function(lon) {
  lon <- lon[1]
  stopifnot(lon >= -180 & lon <= 180)
  lon
}

valid_lat <- function(lat) {
  lat <- lat[1]
  stopifnot(lat >= -90 & lat <= 90)
  lat
}