Skip to content

Commit

Permalink
Merge pull request #78 from ropensci/date_note
Browse files Browse the repository at this point in the history
Better checking of inputs
  • Loading branch information
mbjoseph authored Mar 6, 2023
2 parents 40c887f + a6a72cc commit 6274022
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Depends:
Imports:
hdf5r,
httr (>= 1.1.0),
methods,
rappdirs (>= 0.3.1),
rvest,
terra,
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export(set_smap_credentials)
importFrom(httr,GET)
importFrom(httr,authenticate)
importFrom(httr,write_disk)
importFrom(methods,is)
importFrom(rappdirs,user_cache_dir)
importFrom(terra,crs)
importFrom(terra,ext)
Expand Down
5 changes: 3 additions & 2 deletions R/find_smap.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#'
#' @param id A character string that refers to a specific SMAP dataset, e.g.,
#' \code{"SPL4SMGP"} for SMAP L4 Global 3-hourly 9 km Surface and Rootzone Soil
#' Moisture Geophysical Data. See "Details" for a list of supported data types
#' Moisture Geophysical Data. See "Details" for a list of supported data types
#' and their associated id codes.
#' @param dates An object of class Date or a character string formatted as
#' %Y-%m-%d (e.g., "2016-04-01") which specifies the date(s) to search.
Expand All @@ -57,11 +57,12 @@
#' }
#'
#' @importFrom httr GET
#' @importFrom methods is
#' @export

find_smap <- function(id, dates, version) {
check_creds()
if (class(dates) != "Date") {
if (!is(dates, "Date")) {
dates <- try_make_date(dates)
}
ensure_dates_in_past(dates)
Expand Down
2 changes: 1 addition & 1 deletion man/find_smap.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6274022

Please sign in to comment.