-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
99 lines (85 loc) · 4.18 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
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
branch <- system2("git", c("rev-parse", "--abbrev-ref", "HEAD"), TRUE)
```
# FinBIF R package <img src="man/figures/logo.png" align="right" alt="" width="120">
<!-- badges: start -->
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](https://opensource.org/license/mit-0)
[![CRAN status](https://www.r-pkg.org/badges/version-last-release/finbif)](https://cran.r-project.org/package=finbif)
[![r-universe](https://luomus.r-universe.dev/badges/finbif)](https://luomus.r-universe.dev)
[![CRAN downloads](https://cranlogs.r-pkg.org/badges/grand-total/finbif?color=brightgreen)](https://cran.r-project.org/package=finbif)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3612814.svg)](https://doi.org/10.5281/zenodo.3612814)
[![Build Status](https://github.com/luomus/finbif/workflows/R-CMD-check/badge.svg?branch=`r branch`)](https://github.com/luomus/finbif/actions)
[![codecov](https://codecov.io/gh/luomus/finbif/branch/`r branch`/graph/badge.svg)](https://app.codecov.io/github/luomus/finbif/branch/`r branch`)
<!-- badges: end -->
The `finbif` R package is a programmatic interface to the
[Finnish Biodiversity Information Facility (FinBIF) API](https://api.laji.fi).
FinBIF aggregates Finnish biodiversity data from multiple sources in a single
open access portal for researchers, citizen scientists, industry and government.
FinBIF allows users of biodiversity information to find, access, combine and
visualise data on Finnish plants, animals and microorganisms. The `finbif`
R package makes the publicly available data in FinBIF easily accessible to
programmers. Biodiversity information is available on taxonomy and taxon
occurrence. Occurrence data can be filtered by taxon, time, location and other
variables. The data accessed are conveniently preformatted for subsequent
analyses.
## Installation
You can install the current stable version of `finbif` from
[CRAN](https://cran.r-project.org),
```{r install_cran, eval = FALSE}
install.packages("finbif")
```
You can also install the latest development version of `finbif` from
[GitHub](https://github.com),
```{r install_gh, eval = FALSE}
remotes::install_github("luomus/finbif@dev")
```
## Documentation
Read the online documentation for the current stable version of
`finbif` [here](https://luomus.github.io/finbif/), or the latest development
version of `finbif` [here](https://finbif-docs-dev.netlify.app).
## Getting a FinBIF access token
First load the `finbif` R package.
```{r setup}
library(finbif)
```
To use the FinBIF API you must first request and set a personal access token.
You can request an API token to be sent to your email address with the function
`finbif_get_token`.
```{r request-token, eval = FALSE}
finbif_request_token("[email protected]")
```
Copy the access token that was sent to your email and set it as the environment
variable `FINBIF_ACCESS_TOKEN` either for the current session,
```{r set-token, eval = FALSE}
Sys.setenv(
FINBIF_ACCESS_TOKEN = "xtmSOIxjPwq0pOMB1WvcZgFLU9QBklauOlonWl8K5oaLIx8RniJLrvcJU4v9H7Et"
)
# Note: the above is not a real access token. Do not try using it.
```
, or by adding it to a `Renviron` startup file (see
[here](https://rviews.rstudio.com/2017/04/19/r-for-enterprise-understanding-r-s-startup/)
for details).
## Usage
Download occurrence data from FinBIF.
```{r occurrence, eval = FALSE}
finbif_occurrence("Cygnus cygnus", n = 100)
```
## Citation
```{r citation, results = "asis", echo = FALSE}
print(citation("finbif"), bibtex = FALSE)
```
----
## Contributing
Development is a community effort, and we encourage participation. Please read
[the contribution guide](https://github.com/luomus/finbif/blob/main/CONTRIBUTING.md)
for details.
Please note that the 'finbif' project is released with a
[Contributor Code of Conduct](https://github.com/luomus/finbif/blob/main/CODE_OF_CONDUCT.md).
By contributing to this project, you agree to abide by its terms.