Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterprovoost committed Oct 9, 2024
1 parent 68c38b9 commit b363af4
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,49 +16,53 @@ There are several options available to download data from OBIS, some of which in

- R package [robis](https://github.com/iobis/robis)
- Python package [pyobis](https://github.com/iobis/pyobis)
- Full data exports
- [Full data exports](#full-data-exports)
- [OBIS homepage search](https://obis.org/) or [advanced dataset search](https://obis.org/datasets)
- [OBIS Mapper](https://mapper.obis.org/)


### robis

The [robis R package](https://github.com/iobis/robis) connects to the OBIS API from R. The package can be installed from CRAN or from GitHub (latest development version).
```

```r
# install from CRAN
install.packages("robis")

# latest development version
remotes::install_github("iobis/robis")
```

You can use the package to obtain a list of datasets, a taxon checklist, or raw occurrence data by supplying e.g. a taxon name or [WoRMS AphiaID](https://www.marinespecies.org/about.php). You can also specify whether to include absence records when obtaining occurrence data.
To download this data, simply export R objects with the write.csv function. If we wanted to obtain Mollusc data from OBIS, some options would be:

```
```r
library(robis)
#obtain occurrence data
moll<-occurrence("Mollusca")
moll_abs<-occurrence(“Mollusca”, absence="include") #include absence records
write.csv(moll, “mollusca-obis.csv”)` #save the data to csv

#obtain a list of datasets for a taxon
molldata<-dataset(scientificname="Mollusca")
# obtain occurrence data
moll <- occurrence("Mollusca")
moll_abs <- occurrence(“Mollusca”, absence = "include") # include absence records
write.csv(moll, "mollusca-obis.csv") # save the data to csv

# obtain a list of datasets for a taxon
molldata <- dataset(scientificname = "Mollusca")

#obtain a checklist of Mollusc species in a certain area
mollcheck<-checklist(scientificname="Mollusca", geometry = "POLYGON ((2.3 51.8, 2.3 51.6, 2.6 51.6, 2.6 51.8, 2.3 51.8))")
mollcheck <- checklist(scientificname = "Mollusca", geometry = "POLYGON ((2.3 51.8, 2.3 51.6, 2.6 51.6, 2.6 51.8, 2.3 51.8))")
```

#### Filter datasets by keyword

You can use robis to obtain all datasets and then filter based on keywords in the title and/or abstract. See example below where we filter to find datasets related to seamounts. Multiple keywords can be provided by using | to separate each word, e.g. "seamount|deepsea|benthos".

```
search_terms <- "seamount" #define your search terms
```r
search_terms <- "seamount" # define your search terms

datasets <- robis::dataset() #obtain datasets from OBIS
datasets <- robis::dataset() # obtain datasets from OBIS

seamount_datasets <- datasets[grepl(paste(search_terms, collapse = "|"), datasets$title, ignore.case = TRUE) |
grepl(paste(search_terms, collapse = "|"), datasets$abstract, ignore.case = TRUE),]
seamount_datasets <- datasets[
grepl(paste(search_terms, collapse = "|"), datasets$title, ignore.case = TRUE) |
grepl(paste(search_terms, collapse = "|"), datasets$abstract, ignore.case = TRUE),]
```

## Full data exports
Expand Down

0 comments on commit b363af4

Please sign in to comment.