bcdata

bcdata: An R package for searching & retrieving data from the B.C. Data Catalogue - Published in JOSS (2021)

https://github.com/bcgov/bcdata

Science Score: 93.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 7 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org, zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

bcdc citz data-science env r r-package rstats

Keywords from Contributors

species-sensitivity-distribution
Last synced: 6 months ago · JSON representation

Repository

An R package for searching & retrieving data from the B.C. Data Catalogue

Basic Info
Statistics
  • Stars: 84
  • Watchers: 17
  • Forks: 13
  • Open Issues: 27
  • Releases: 15
Topics
bcdc citz data-science env r r-package rstats
Created about 7 years ago · Last pushed 11 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct

README.Rmd

---
output:
  github_document:
html_preview: true
---





```{r setup, echo = FALSE, warning = FALSE, message = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/"
)
library(bcdata)
```


# bcdata 




[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/license/apache-2-0)
[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/bcdata)](https://cran.r-project.org/package=bcdata) [![CRAN Downloads](https://cranlogs.r-pkg.org/badges/bcdata?color=brightgreen)](https://CRAN.R-project.org/package=bcdata) [![cran checks](https://cranchecks.info/badges/worst/bcdata)](https://CRAN.R-project.org/web/checks/check_results_bcdata.html)
[![img](https://img.shields.io/badge/Lifecycle-Maturing-007EC6)](https://github.com/bcgov/repomountie/blob/master/doc/lifecycle-badges.md)
[![DOI](https://joss.theoj.org/papers/10.21105/joss.02927/status.svg)](https://doi.org/10.21105/joss.02927)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4737824.svg)](https://doi.org/10.5281/zenodo.4737824)
[![Codecov test coverage](https://codecov.io/gh/bcgov/bcdata/branch/main/graph/badge.svg)](https://app.codecov.io/gh/bcgov/bcdata?branch=main)
[![R-CMD-check](https://github.com/bcgov/bcdata/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/bcgov/bcdata/actions/workflows/R-CMD-check.yaml)


An R package 📦 for searching & retrieving data from the [B.C. Data Catalogue]( https://catalogue.data.gov.bc.ca).

- `bcdc_browse()` - Open the catalogue in your default browser
- `bcdc_search()` - Search records in the catalogue
- `bcdc_search_facets()` - List catalogue facet search options
- `bcdc_get_record()` - Print a catalogue record
- `bcdc_tidy_resources()` - Get a data frame of resources for a record
- `bcdc_get_data()` - Get catalogue data
- `bcdc_query_geodata()` - Get & query catalogue geospatial data available through a [Web Feature Service](https://en.wikipedia.org/wiki/Web_Feature_Service)

**Note:** The `bcdata` package supports downloading _most_ file types, including zip archives. It will do its best to identify and read data from
zip files, however if there are multiple data files in the zip, or data files that `bcdata` doesn't know how to import, it will fail. 
If you encounter a file type in the B.C. Data Catalogue not currently supported by `bcdata` please file an [issue](https://github.com/bcgov/bcdata/issues/). 

### Reference
[bcdata package 📦 home page and reference guide](https://bcgov.github.io/bcdata/)

### Installation
You can install `bcdata` directly from [CRAN](https://cran.r-project.org/package=bcdata): 

```{r eval=FALSE}
install.packages("bcdata")
```

To install the development version from GitHub, use the [remotes](https://cran.r-project.org/package=remotes) package:

```{r eval=FALSE}
install.packages("remotes")

remotes::install_github("bcgov/bcdata")
library(bcdata)
```


### Vignettes

- [Get Started with bcdata](https://bcgov.github.io/bcdata/articles/bcdata.html)
- [Querying Spatial Data with bcdata](https://bcgov.github.io/bcdata/articles/efficiently-query-spatial-data-in-the-bc-data-catalogue.html)
- [Exploring Silviculture Data with bcdata](https://bcgov.github.io/bcdata/articles/explore-silviculture-data-using-bcdata.html)

### Methods for `bcdc_promise`

The `bcdc_query_geodata()` returns an object of the class `bcdc_promise`. We have written an ever growing list methods for this class. You can use these methods directly on a object returned by `bcdc_query_geodata()`. Here are all the methods for the `bcdc_promise` class:

```{r echo=FALSE, results='asis'}
bcdc_methods <- methods(class = "bcdc_promise")
bcdc_methods <- sort(attributes(bcdc_methods)$info[,c("generic"), ])

cat(paste0("- `", bcdc_methods, "`", collapse = "\n"))
```


### BCDC Authentication

If you are an authorized editor of the B.C. Data Catalogue you may want to
access records that are not publicly available (e.g., in DRAFT, waiting to be
published). This can be done by authenticating with the catalogue with an API
key.

_**Important Note:**_ *Your API key is like a password and you must take care to
keep it private. Do not share it, and be careful to not include it in any
scripts or accidentally commit it to GitHub.*

You can log in to the catalogue to obtain your API key, then store it as an
environment variable in your [`.Renviron` file](https://rstats.wtf/r-startup.html#renviron). 
The environment variable must be called `BCDC_KEY`, set like this:

```
BCDC_KEY=your-api-key
```

This way, the relevant bcdata functions will read that key and use it to
authorize your calls to the catalogue, allowing you to access additional records
that you are authorized to see if you were logged into the catalogue web
interface. Functions that benefit from this are:

- `bcdc_search()`
- `bcdc_list()`
- `bcdc_get_record()`
- `bcdc_get_data()`

### Getting Help or Reporting an Issue

To report bugs/issues/feature requests, please file an [issue](https://github.com/bcgov/bcdata/issues/).

### How to Contribute

If you would like to contribute to the package, please see our 
[CONTRIBUTING](https://github.com/bcgov/bcdata/blob/master/CONTRIBUTING.md) guidelines.

Please note that this project is released with a [Contributor Code of Conduct](https://github.com/bcgov/bcdata/blob/master/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.

### Citation
```{r, echo=FALSE, comment=""}
citation("bcdata")
```


### License

Copyright 2018 Province of British Columbia

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and limitations under the License.

---
*This project was created using the [bcgovr](https://github.com/bcgov/bcgovr) package.* 

Owner

  • Name: bcgov
  • Login: bcgov
  • Kind: organization
  • Email: Developer.Experience@gov.bc.ca
  • Location: Canada

This is the home for code that is open

JOSS Publication

bcdata: An R package for searching & retrieving data from the B.C. Data Catalogue
Published
May 08, 2021
Volume 6, Issue 61, Page 2927
Authors
Andrew C. Teucher ORCID
State of Environment Reporting, Ministry of Environment and Climate Change Strategy, Province of British Columbia
Sam J. Albers ORCID
Data Science Partnerships, Ministry of Citizens' Services, Province of British Columbia
Stephanie L. Hazlitt ORCID
Data Science Partnerships, Ministry of Citizens' Services, Province of British Columbia
Editor
Arfon Smith ORCID
Tags
open data WFS British Columbia Canada

GitHub Events

Total
  • Create event: 6
  • Release event: 2
  • Issues event: 24
  • Watch event: 1
  • Delete event: 5
  • Issue comment event: 71
  • Push event: 48
  • Pull request review event: 25
  • Pull request review comment event: 22
  • Pull request event: 15
  • Fork event: 1
Last Year
  • Create event: 6
  • Release event: 2
  • Issues event: 24
  • Watch event: 1
  • Delete event: 5
  • Issue comment event: 71
  • Push event: 48
  • Pull request review event: 25
  • Pull request review comment event: 22
  • Pull request event: 15
  • Fork event: 1

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 1,157
  • Total Committers: 25
  • Avg Commits per committer: 46.28
  • Development Distribution Score (DDS): 0.468
Past Year
  • Commits: 50
  • Committers: 4
  • Avg Commits per committer: 12.5
  • Development Distribution Score (DDS): 0.24
Top Committers
Name Email Commits
Andy Teucher a****r@g****a 616
Sam Albers s****s@g****a 361
stephhazlitt s****t@g****a 146
hgriesbauer 4****r 5
Julie j****y@g****a 5
repo-mountie[bot] 4****] 4
Bruno Tremblay m****z@n****m 2
runner r****r@M****l 1
runner r****r@M****l 1
runner r****r@M****l 1
runner r****r@M****l 1
runner r****r@M****l 1
runner r****r@M****l 1
runner r****r@M****l 1
runner r****r@M****l 1
runner r****r@M****l 1
runner r****r@M****l 1
runner r****r@M****l 1
runner r****r@M****l 1
runner r****r@M****l 1
runner r****r@M****l 1
runner r****r@M****l 1
runner r****r@M****l 1
Alexandre Bevington a****n@g****a 1
Maximilian Girlich m****h@m****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 83
  • Total pull requests: 62
  • Average time to close issues: 5 months
  • Average time to close pull requests: 2 months
  • Total issue authors: 23
  • Total pull request authors: 6
  • Average comments per issue: 3.82
  • Average comments per pull request: 1.82
  • Merged pull requests: 53
  • Bot issues: 1
  • Bot pull requests: 0
Past Year
  • Issues: 12
  • Pull requests: 12
  • Average time to close issues: 4 days
  • Average time to close pull requests: 4 days
  • Issue authors: 7
  • Pull request authors: 4
  • Average comments per issue: 4.25
  • Average comments per pull request: 1.58
  • Merged pull requests: 9
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • ateucher (32)
  • stephhazlitt (15)
  • boshek (8)
  • MilesMcBain (5)
  • smnorris (2)
  • gcperk (2)
  • ashjolly (2)
  • j-krogh (1)
  • repo-mountie[bot] (1)
  • mgirlich (1)
  • stephanieyurchak (1)
  • aylapear (1)
  • twedl (1)
  • a-potapova (1)
  • paulinamarczak (1)
Pull Request Authors
  • ateucher (29)
  • boshek (25)
  • stephhazlitt (6)
  • bevingtona (4)
  • hadley (2)
  • mgirlich (1)
Top Labels
Issue Labels
enhancement (14) joss review (10) bug (6) joss blocker (6) documentation (5) wfs (4) vignette (3) in-progress (1) maintenance (1) on hold (1) catalogue (1) considering (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 596 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 14
  • Total versions: 14
  • Total maintainers: 1
cran.r-project.org: bcdata

Search and Retrieve Data from the BC Data Catalogue

  • Versions: 14
  • Dependent Packages: 1
  • Dependent Repositories: 14
  • Downloads: 596 Last month
Rankings
Stargazers count: 4.6%
Forks count: 5.8%
Dependent repos count: 7.7%
Average: 10.5%
Downloads: 16.2%
Dependent packages count: 18.2%
Maintainers (1)
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • DBI * imports
  • cli * imports
  • crul >= 1.1.0 imports
  • dbplyr >= 2.0.0 imports
  • dplyr >= 0.8.1 imports
  • glue * imports
  • jsonlite >= 1.6 imports
  • leaflet * imports
  • leaflet.extras * imports
  • methods * imports
  • purrr >= 0.2 imports
  • readr >= 1.3 imports
  • readxl * imports
  • rlang >= 0.3.1 imports
  • sf >= 0.7 imports
  • tibble * imports
  • tidyselect >= 0.2.5 imports
  • utils * imports
  • xml2 * imports
  • covr * suggests
  • ggplot2 * suggests
  • knitr * suggests
  • rmarkdown * suggests
  • testthat * suggests
  • withr * suggests
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action 4.1.4 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pr-commands.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/pr-fetch v2 composite
  • r-lib/actions/pr-push v2 composite
  • r-lib/actions/setup-r v2 composite
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite