ropensci / chirps

API Client for CHIRPS
https://docs.ropensci.org/chirps/
Other
31 stars 12 forks source link

get_chirts(as.matrix = TRUE) returns a data.frame #53

Open adamhsparks opened 1 month ago

adamhsparks commented 1 month ago

e.g.

# setup values for testing all
lonlat <-
  structure(list(
    lon = c(-60.03947, -54.7838828),
    lat = c(-3.031387, -2.4221716)
  ),
  class = "data.frame",
  row.names = c(NA, -2L))
dates <- c("2000-01-01", "2000-01-05")
chirts_values <-
  c(
    29.4855480194092,
    29.5689563751221,
    29.5717449188232,
    32.0975608825684,
    29.1689014434814,
    29.5432586669922,
    29.4775066375732,
    28.201681137085,
    29.9562358856201,
    30.5279235839844
  )

class(get_chirts(
  object = lonlat,
  dates = dates,
  var = "Tmax",
  as.matrix = TRUE
))
[1] "data.frame"