Learn R Programming

pestr (version 0.8.4)

eppo_database: EPPO Data Services Database connection tools

Description

[Stable] eppo_database_check checks if there is a file eppocodes.sqlite and informs user if it is outdated and should be downloaded. eppo_database_download DEPRECATED. eppo_database_connect allows user to connect to SQLite database downloaded from EPPO Data Services.

Usage

eppo_database_check(filepath = getwd(), filename = "eppocodes.sqlite")

eppo_database_download(filepath = getwd())

eppo_database_connect(filepath = getwd(), filename = "eppocodes.sqlite")

Value

Checks if database file exist in directory, if it is outdated, and establishes SQLite database connection

Arguments

filepath

A string with path where eppocodes.sqlite file is stored. By default it points to working directory.

filename

A string with name of the file. By default it takes name eppocodes.sqlite.

Manual download

If you will, you can download database directly from EPPO Data Services https://data.eppo.int

Examples

Run this code
if (FALSE) {
#to check if the db file exist in the directory (default working directory)

eppo_database_check(filepath = getwd())

#to download EPPO SQLite database into directory (default working directory).
#If you are Windows user, after download finishes you will need to unzip file
#manualy.

eppo_database_download(filepath = getwd())

#prior to use functions that check pest names in SQLite database,
#you need to set up connection to SQLite database. Doing so is
#straightforward with function below (once per sesion):

eppo_connection <- eppo_database_connect(filepath = getwd(),
                                         filename = "eppocodes.sqlite")
}

Run the code above in your browser using DataLab