forked from DOI-USGS/sbtools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
113 lines (81 loc) · 3.75 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
ScienceBase R Tools
===
Tools for interfacing R with ScienceBase data services.
## Package Description
This package provides a rich interface to USGS's [ScienceBase](https://www.sciencebase.gov/), a data cataloging and collaborative data management platform. For further information, see the [sbtools manuscript in The R Journal](https://journal.r-project.org/archive/2016-1/winslow-chamberlain-appling-etal.pdf) (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
|Linux|Test Coverage|
|----------|------------|
| ![R-CMD-check](https://github.com/doi-usgs/sbtools/workflows/R-CMD-check/badge.svg) |[![codecov.io](https://codecov.io/github/DOI-USGS/sbtools/coverage.svg?branch=master)](https://app.codecov.io/github/DOI-USGS/sbtools?branch=master)|
### Current CRAN information
|Version|Monthly Downloads|Total Downloads|
|----------|------------|------------|
|[![CRAN version](https://www.r-pkg.org/badges/version/sbtools)](https://cran.r-project.org/package=sbtools)|[![](https://cranlogs.r-pkg.org/badges/sbtools)](https://cran.r-project.org/package=sbtools)|[![](https://cranlogs.r-pkg.org/badges/grand-total/sbtools)](https://cran.r-project.org/package=sbtools)|
## Package Installation
To install the `sbtools` package, you must be using R 3.0 or greater and run the following command:
```r
install.packages("sbtools")
```
To get cutting-edge changes, install from GitHub using the `devtools` packages:
```r
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](https://github.com/DOI-USGS/sbtools/issues)
## Examples
```{r example, eval=TRUE}
library(sbtools)
# Query ScienceBase for data about Antarctica
query_sb_text('Antarctica', limit=1)
# Query for a specific DOI
query_sb_doi('10.5066/F7M043G7')
# Inspect the contents of the above item
children <- item_list_children('557f0367e4b023124e8ef621')
sapply(children, function(child) child$title)
# Log in (requires a ScienceBase account) and create an item
authenticate_sb(Sys.getenv("sb_user")) # type in password
my_home_item <- user_id()
new_item <- item_create(title = 'new test item', parent_id = my_home_item)
test.txt <- file.path(tempdir(), 'test.txt')
writeLines(c('this is','my data file'), "test.txt")
item_append_files(new_item, "test.txt")
item_list_files(new_item)$fname
item_rm(new_item)
unlink("test.txt")
```
## Release Procedure
For release of the sbtools package, a number of steps are required.
1. Ensure all checks pass and code coverage is adequate.
1. Ensure `NEWS.md` reflects updates in version.
1. Update `DESCRIPTION` to reflect release version.
1. Convert `DISCLAIMER.md` to approved language and rebuild `README.Rmd`.
1. Create release candidate branch and commit release candidate.
1. Build source package and upload to CRAN.
1. Once accepted to CRAN, tag release candidate branch an push to repositories.
1. Change `DISCLAIMER.md` back to development mode and increment description version.
1. Merge release candidate and commit.
1. Open PR/MR in development state.
```{r disclaimer, child="DISCLAIMER.md", eval=TRUE}
```
[
![CC0](https://i.creativecommons.org/p/zero/1.0/88x31.png)
](https://creativecommons.org/publicdomain/zero/1.0/)