An R package 📦 for searching & retrieving data from the B.C. Data Catalogue.
bcdc_browse()
- Open the catalogue in your default browserbcdc_search()
- Search records in the cataloguebcdc_search_facets()
- List catalogue facet search optionsbcdc_get_record()
- Print a catalogue recordbcdc_tidy_resources()
- Get a data frame of resources for a recordbcdc_get_data()
- Get catalogue databcdc_query_geodata()
- Get & query catalogue geospatial data available through a Web 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.
bcdata package 📦 home page and reference guide
You can install bcdata
directly from
CRAN:
install.packages("bcdata")
To install the development version from GitHub, use the remotes package:
install.packages("remotes")
remotes::install_github("bcgov/bcdata")
library(bcdata)
- Get Started with bcdata
- Querying Spatial Data with bcdata
- Exploring Silviculture Data with bcdata
- Using bcdata with bcmaps (Coming Soon!)
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. 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()
To report bugs/issues/feature requests, please file an issue.
If you would like to contribute to the package, please see our CONTRIBUTING guidelines.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
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
http://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 package.