Learn R Programming

ScienceBase R Tools

Tools for interfacing R with ScienceBase data services.

Package Description

This package provides a rich interface to USGS’s ScienceBase, a data cataloging and collaborative data management platform. For further information, see the sbtools manuscript in The R Journal (USGS IP-075498). See citation('sbtools') for how to cite the package.

Recommended Citation:

  Winslow, LA, S Chamberlain, AP Appling, and JS Read. 2016. sbtools: 
  A package connecting R to cloud-based data for collaborative online 
  research. The R Journal 8:387-398.

Package source code DOI: https://doi.org/10.5066/P912NGFV

LinuxTest Coverage

Current CRAN information

VersionMonthly DownloadsTotal Downloads

Package Installation

To install the sbtools package, you must be using R 3.0 or greater and run the following command:

install.packages("sbtools")

To get cutting-edge changes, install from GitHub using the devtools packages:

remotes::install_github("DOI-USGS/sbtools")

Reporting bugs

Please consider reporting bugs and asking questions on the Issues page:

https://github.com/DOI-USGS/sbtools/issues

Release Procedure

For release of the sbtools package, a number of steps are required.

  1. Ensure all checks pass and code coverage is adequate.
  2. Ensure NEWS.md reflects updates in version.
  3. Update DESCRIPTION to reflect release version.
  4. Convert DISCLAIMER.md to approved language and rebuild README.Rmd.
  5. Create release candidate branch and commit release candidate.
  6. Build source package and upload to CRAN.
  7. Once accepted to CRAN, tag release candidate branch an push to repositories.
  8. Change DISCLAIMER.md back to development mode and increment description version.
  9. Merge release candidate and commit.
  10. Open PR/MR in development state.

Disclaimer

This software is preliminary or provisional and is subject to revision. It is being provided to meet the need for timely best science. The software has not received final approval by the U.S. Geological Survey (USGS). No warranty, expressed or implied, is made by the USGS or the U.S. Government as to the functionality of the software and related material nor shall the fact of release constitute any such warranty. The software is provided on the condition that neither the USGS nor the U.S. Government shall be held liable for any damages resulting from the authorized or unauthorized use of the software.

Copy Link

Version

Install

install.packages('sbtools')

Monthly Downloads

409

Version

1.3.2

License

CC0

Issues

Pull Requests

Stars

Forks

Maintainer

David Blodgett

Last Published

March 21st, 2024

Functions in sbtools (1.3.2)

item_replace_files

Replace files associated with an item
items_upsert

Upsert many SB items
items_update

Update many SB items with new metadata
item_publish_cloud

Publish file to public cloud S3 bucket
readPassword

Read in a password from the user
query_sb_text

Query SB for items containing specific text
authenticate_sb

Authenticate to SB for subsequent calls
current_session

Return current cached session
item_list_files

Get list of files attached to SB item
sbtools-package

R interface to ScienceBase
sbitem

ScienceBase item class
item_rename_files

Rename item attached files
item_move

Move item from one folder to another
item_get_parent

Get an item's parent ID
item_list_children

Return IDs for all child items
item_get_fields

Retrieve specific fields from an SB item
item_get

Retrieve SB item
item_rm

Remove item from SB
item_upsert

Upsert an SB item
item_upload_cloud

Upload File to Item Cloud Storage
item_upload_create

#' Upload file(s) and create a new item
items_create

Create many new SB items
item_update

Update a SB item with new metadata
query_sb_date

Query SB for items within a date range
item_rm_files

Remove files associated with an item
query_sb_datatype

Query SB for specific data type
sb_datatypes

Query SB for all available datatypes
item_update_identifier

Add custom identifier to an existing item
sb_ping

Ping ScienceBase to see if it's available
query_sb_spatial

Query SB based on spatial extent
query_sb_doi

Query SB for specific DOI (Digital Object Identifier)
set_endpoint

Set SB endpoint
user_id

Get your parent ID
session_details

Get session info (deprecated)
query_item_identifier

Query SB for items based on custom identifier
item_rm_recursive

Remove an item completely by recursively removing its child items
query_items

Query SB for items using generic query parameters
query_item_in_folder

Search within an SB folder
sbtools_PUT

generic PUTs for sbtools package
session_expired

Check whether an SB session is expired
session_age

a convienence function for getting the age of a session.
query_sb

Query SB for items using generic query parameters
session_renew

Checks current session and re-authenticates if necessary
session_validate

Validate sbtools session state
sbtools_GET

generic GETs for sbtools package
sbtools_POST

generic POSTs for sbtools package package wrapped for generic POSTs that test sessions internally and wrap some errors
item_append_files

Upload File to Item
item_exists

check if identifier touple already exists on SB
item_file_download

Download files attached to item
initialize_sciencebase_session

Initialize ScienceBase Session
is_logged_in

Check whether you're logged into a ScienceBase session
item_create

Create a new SB item
folder_create

Create a folder
identifier_exists

Check if identifier exists