README.md

Build Status

Installation

This should automatically install the package from a CRAN mirror if you have one configured:

install.packages("ridigbio")

If R says the package is unavailable, you may not have set a CRAN mirror. You can do so with:

chooseCRANmirror()

If R says that a binary package is not available, your version of R may be too old. Please review the versions of R that CRAN has built packages for on the CRAN ridigbio package page. You can download the source package and install manually if there is no package built for your version of R. You may also need to install any dependencies.

install.packages("ridigbio", type="source")

On Linux, you may encounter an error during the installation process if you do not have libcurl installed. The method for installing libcurl will vary between distributions, but on Ubuntu you can install the latest version via:

sudo apt install libcurl4

Basic usage

library("ridigbio")
idig_search_records(rq=list(genus="galax"))
idig_search_records(rq=list(family="holothuriidae"), limit=1000)

Complete list of terms that can be used is available here. However, this only contains a subset of the fields. To see all raw fields available with the record API, you can run the following:

record_fields <- idig_meta_fields(type = "records", subset = "raw")
rfall <- data.frame(matrix(ncol = 3, nrow = 0))
for(i in 1:length(record_fields)){
  if(length(record_fields[[i]]) == 2){
    rf <- data.frame(matrix(ncol = 3, nrow = 0))
    rf[1, 1] <-  names(record_fields[i])
    rf[1, 2] <-  (record_fields[[i]])$type
    rf[1, 3] <-  (record_fields[[i]])$fieldName
    rfall <- rbind(rfall, rf)
  }else{
    sub <- record_fields[[i]]
    for(j in 1:length(sub)){
      rf <- data.frame(matrix(ncol = 3, nrow = 0))
      rf[1, 1] <-  names(sub[j])
      rf[1, 2] <-  (sub[[j]])$type
      rf[1, 3] <-  (sub[[j]])$fieldName
      rfall <- rbind(rfall, rf)
    }
  }
}
colnames(rfall) <- c("name", "type", "fieldName")

Recent updates

License

MIT



iDigBio/ridigbio documentation built on Feb. 3, 2024, 4:41 p.m.