Learn R Programming

Rveg (version 0.1.8)

RvegToTv: RvegToTv: Export an Rveg Database to Turboveg Compatible Format

Description

Exports an existing Rveg database into a CSV format compatible with the Turboveg vegetation database management system. The function automatically reconstructs full botanical names from the internal ShortName codes and maps vegetation layers to standard Turboveg abbreviations.

Usage

RvegToTv(database, export = "export", checklist = "default", ver = 3)

Value

Writes one or two CSV files to the location specified by export, depending on the chosen Turboveg version.

Arguments

database

Character. The path and name of the existing Rveg database to be exported (e.g., "path/to/my_db").

export

Character. The output path and name where the resulting Turboveg CSV file(s) will be saved. Defaults to a temporary directory.

checklist

Character. The species checklist used to match Rveg's 7-character ShortName codes back to their full botanical names. Defaults to "default".

ver

Numeric. The target Turboveg version format to export to (either 2 or 3). Defaults to 3.

Details

During export, Rveg's alphanumeric layers are translated into Turboveg's specific layer codes (e.g., 0 becomes ml, 1 becomes hl, 2 becomes s1, 3 becomes t1, and J becomes jl).

The output structure changes depending on the target Turboveg version specified by the ver parameter:

  • Turboveg v3 (ver = 3): Writes a single, combined .csv file containing both header and species data.

  • Turboveg v2 (ver = 2): Writes two separate files: *R.csv for relevé species data and *H.csv for header data.

Examples

Run this code
# Example: Exporting the built-in Rveg database to Turboveg v3 format
RvegToTv(
  database = file.path(path.package("Rveg"), "extdata/ExampleDB", "example_1"),
  ver = 3
)

Run the code above in your browser using DataLab