Skip to contents

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

if (FALSE) {
# 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)

}