query_sb_date: Query SB for items within a date range

View source: R/query_sb.R

query_sb_dateR Documentation

Query SB for items within a date range

Description

Queries ScienceBase for items with timestamps within a certain date/time range.

Usage

query_sb_date(
  start = as.POSIXct("1970-01-01"),
  end = Sys.time(),
  date_type = "lastUpdated",
  ...,
  limit = 20
)

Arguments

start

Start date as POSIXct object. Defaults to 1970-01-01

end

End date as POSIXct object. Defaults to today.

date_type

Which object timestamp to query against. Options are (case sensitive): 'Acquisition', 'Award', 'Collected', 'dateCreated', 'Received', 'Reported', 'Transmitted', 'Due', 'End', 'Info', 'lastUpdated', 'Publication', 'Release', 'Repository Created', 'Repository Updated', 'Start'.

...

Additional parameters are passed on to GET

limit

Maximum number of returned items. Will do paging to retrieve results when limit is over 1000. Use with caution, queries 10k results are slow.

Examples

## Not run: 
# find items updated today
query_sb_date(Sys.time(), Sys.time())

# find items with publications from the 1970's
query_sb_date(as.POSIXct('1970-01-01'), as.POSIXct('1980-01-01'), 
  date_type='Publication', limit=1000)


## End(Not run)


USGS-R/sbtools documentation built on June 1, 2024, 9:47 p.m.