MyNixOS website logo
Description

Interface to Download Data on Pests and Hosts from 'EPPO'.

Set of tools to automatize extraction of data on pests from 'EPPO Data Services' and 'EPPO Global Database' and to put them into tables with human readable format. Those function use 'EPPO database API', thus you first need to register on <https://data.eppo.int> (free of charge). Additional helpers allow to download, check and connect to 'SQLite EPPO database'.

pestr

Lifecycle: maturing License: MIT Build Status R-CMD-check codecov

Functions included in this package allows users to painlessly connect to and extract data from EPPO Data Services / EPPO Global Database. Before you start using it you should register on: EPPO Data Services and obtain your token to access REST API.

Installation

You can install and use pestr development version from GitHub as follows:

devtools::install_github("mczyzj/pestr")

Overview and Usage

Package include function that allow you to download SQLite database eppo_database_download (archive around 12 MB, after extraction around 45 MB). The database is needed for extracting eppocodes that are used in other functions from this package. Function included in eppo_tabletools_ family return both:

  • table of raw results in so called long format (machine friendly)
  • processed, compact table, that contain all information in one row per one pest.

Before using functions that connect to REST API (hosts, categorization, taxonomy and pests) you should execute create_eppo_token function with string argument equal to your personal EPPO Data Services token. This function creates global variable eppo_token which should be parsed as an argument to functions that require token argument.

eppo_table_full allow to execute all the functions and return compact table with information on names, hosts, categorization, distribution and taxonomy -- one row per one pest.

Feel free to contribute to this package and report issues via GitHub or email.

Example workflow

First you need to create token variable, use your token from EPPO Data Services.

create_eppo_token('<<your token>>')

Than:

  • on LINUX: use function to automatically download and unizp SQLite db from EPPO
eppo_database_download()
  • on Windows: download SQLite db using:
eppo_database_download() #by default it downloads to working directory
#you can override this behaviour filepath argument

and extract the file manually to project working directory.

Put all the names that you are looking for into a vector, e.g.:

pests <- c(''Xylella', Cydia packardi', 'Drosophila suzuki')

and make connection to database.

eppo_SQLite <- eppo_database_connect()

pests names

Get pest names using:

pests_names_tables <- eppo_names_tables(pests, eppo_SQLite)

in result you will have list containing 4 tables:

  • data frame with names that are present in EPPO Data Services;
  • data frame with names that are not present EPPO Data Services;
  • data frame with preferred names and eppo codes EPPO Data Services;
  • data frame with all associated names to eppocode from third data frame.

You might parse results of this function directly to eppo_tabletools_ to obtain data. Other way is to use raw eppocodes as argument (this workflow is explained in Vignettes).

pests categorization

Using:

pests_cat <- eppo_tabletools_cat(pests_names_tables, eppo_token)

you will get as result you will get list with two elements:

  • data frame with categorization tables for each eppocode in long format;
  • a single data frame with categorization for each eppocode condensed into a single cell.

pest hosts

pests_hosts <- eppo_tabletools_hosts(pests_names_tables, eppo_token)

result with two tables:

  • first is a data frame in long format with all data for all pests;
  • second is a data frame where hosts are combined into single cell for each eppocode.

pests taxonomy

To get taxonomy use:

pests_taxo <- eppo_tabletools_taxo(pests_names_tables, eppo_token)

This function results are a list of two data frames:

  • first is a long format table;
  • second is table with 'main category' of each eppocode.

pest distribution

The function extracting distribution from EPPO Global Database does not need eppo_token. It can be called like:

pest_distri <- eppo_tabletools_distri(pests_names_tables)

The result is a two element list:

  • first one contains data frame of distribution in long format;
  • second contains single cell of distribution for each eppocode.

pest names, categorization, distribution, taxonomy and hosts in one shot

Whole condensed table in one shot:

eppo_fulltable <- eppo_table_full(pests, eppo_SQLite, eppo_token)

which you can easily save as csv and use in a spreadsheet:

write.csv(eppo_fulltable, 'eppo_fulltable.csv')

hosts pests

Since the EPPO Data Services provides information on pest of particular host, you can easily access information with:

hosts <- c("Abies alba", "Triticum")

hosts_names_tables <- eppo_names_tables(pests, eppo_SQLite)
hosts_pests <- eppo_tabletools_taxo(hosts_names_tables, eppo_token)

TODO:

  • Internationalization
  • Connection to pestrPRA.
Metadata

Version

0.8.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows