| Title: | Digitization of Phytosociological Relevés |
|---|---|
| Description: | Simple and fast tool for transforming phytosociological vegetation data into digital form for the following analysis. Danihelka, Chrtek, and Kaplan (2012, ISSN:00327786). Hennekens, and Schaminée (2001) <doi:10.2307/3237010>. Tichý (2002) <doi:10.1111/j.1654-1103.2002.tb02069.x>. Wickham, François, Henry, Müller (2022) <https://CRAN.R-project.org/package=dplyr>. |
| Authors: | Přemysl Král [aut, cre] (ORCID: <https://orcid.org/0000-0002-2887-651X>), Jan Douda [aut] (ORCID: <https://orcid.org/0000-0002-1205-364X>) |
| Maintainer: | Přemysl Král <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.1.11 |
| Built: | 2026-05-26 08:07:37 UTC |
| Source: | https://github.com/sesitcsl2/rveg |
The core interactive function of the Rveg package. addReleve() launches a
console-based menu system that allows users to create new vegetation databases,
digitize new relevés, and edit existing ones. It seamlessly manages both the
species composition data (REL) and the environmental plot header data (HEAD).
Parameter start was removed.
For list of commands in addReleve menu prompt help or ?
addReleve( database = "NEW", save = "default", checklist = "default", customhead = NULL, extrahead = NULL, metadata = NULL )addReleve( database = "NEW", save = "default", checklist = "default", customhead = NULL, extrahead = NULL, metadata = NULL )
database |
Character. The path and name of an existing Rveg database
(e.g., |
save |
Character. The output path and name where the resulting database
files ( |
checklist |
Character. The species checklist to use. Can be a built-in
checklist (atm: |
customhead |
Character vector. A vector of strings defining completely custom header fields. Overrides the default schema. |
extrahead |
Character vector. Additional header fields to append to the end of the default or existing header schema. |
metadata |
Character vector of length 2. Used to store the Project Title
and Project Description (e.g., |
Writes two linked CSV files (Rveg database) to the location specified by save: one
containing the relevé species data (*REL.csv) and one containing the header data (*HEAD.csv).
if (interactive()) { # Launch the interactive menu for a new database addReleve( database = "NEW", save = "my_new_project", metadata = c("Project Title", "Project Description") ) }if (interactive()) { # Launch the interactive menu for a new database addReleve( database = "NEW", save = "my_new_project", metadata = c("Project Title", "Project Description") ) }
Generates a custom species checklist formatted for use within the Rveg package.
This function takes a list of full botanical names and deterministically converts
them into unique, 7-character ShortName codes.
Rveg includes the following
built-in checklists:
cz_dh2012 (Default: Checklist of vascular plants of the Czech Republic)
Czechia_slovakia_2015 (Turboveg compatible checklist)
cz_kaplan2019 (Rveg generated - Kaplan et al. 2019)
wcvp_que (example WCVP subset for Quebec)
wcvp_por (example WCVP subset for Portugal)
CreateChecklist(specieslist, export = "export")CreateChecklist(specieslist, export = "export")
specieslist |
Character vector OR Character. Either a vector
of full botanical names in your R environment, or a path to a |
export |
Character. The output path and name for the exported checklist. Defaults to a temporary directory. |
ShortName Generation Rules: The function guarantees a unique 7-character code for every species. The first 4 characters always represent a unique Genus code. The remaining 3 characters depend on the taxonomic rank:
Standard Species: Genus (4) + first 3 letters of the specific epithet (e.g., GENUEPI).
Species (sp.): Genus (4) + -SP (e.g., GENU-SP).
Hybrids (x): Genus (4) + * + first 2 letters of hybrid epithet (e.g., GENU*HY).
Aggregates (agg.): Genus (4) + # + first 2 letters of main epithet (e.g., GENU#EP).
Subspecies (ssp.): Genus (4) + first letter of main epithet + - + first letter of infra epithet (e.g., GENUE-I).
Varieties/Forms (var./f.): Genus (4) + first letter of main epithet + ; + first letter of infra epithet (e.g., GENUE;I).
Sections (sect.): Genus (4) + SE + first letter of section epithet (e.g., GENUSEE).
Note: If a 7-character code clash occurs, the 7th character is automatically adjusted using trailing letters or alphanumeric fallbacks to ensure absolute uniqueness.
Writes a .txt file containing two columns (ShortName and FullName)
to the location specified by export. The output can be then used
inside addReleve and other functions.
# Example 1: Creating a checklist from a local txt file CreateChecklist( specieslist = paste0(path.package("Rveg"), "/extdata/SpeciesList"), )# Example 1: Creating a checklist from a local txt file CreateChecklist( specieslist = paste0(path.package("Rveg"), "/extdata/SpeciesList"), )
A diagnostic and managing utility to verify the health and integrity of an Rveg database.
RvegCheck() reads your database, checks for missing or corrupted data,
and outputs a summary of the database's current state.
RvegCheck(database, export = "export", checklist = "default")RvegCheck(database, export = "export", checklist = "default")
database |
Character. The path and name of the existing |
export |
Character. The output path and name where the modified database will be saved. Defaults to a temporary directory. |
checklist |
Character. The species checklist to validate the database against. By default, it uses the checklist defined in the database's metadata. |
Note: This function is currently under active development. #'
At present, the function serves primarily as a diagnostic and metadata-repair tool.
When run, it checks the database for a project_name and project_description.
If these are missing, it will interactively prompt the user to supply them. It also
prints vital database statistics, including the internal ID, creation date, last
modification date, and any custom species added to the checklist.
In future updates, this function will also allow users to modify core database parameters, such as swapping the underlying species checklist or altering the header schema.
Currently prints diagnostic information directly to the R console.
If modifications are made, it exports the updated database files (*HEAD.csv
and *REL.csv) to the path specified by export.
RvegMerge for combining databases, RvegCombine for manipulating data within a database.
if (interactive()) { # Inspect the built-in example database RvegCheck( database = file.path(path.package("Rveg"), "extdata/ExampleDB", "example_1") ) }if (interactive()) { # Inspect the built-in example database RvegCheck( database = file.path(path.package("Rveg"), "extdata/ExampleDB", "example_1") ) }
An interactive utility that allows users to merge the abundance covers of
specific species or entire vegetation layers within an existing Rveg database.
RvegCombine(database, export = "export", checklist = "default")RvegCombine(database, export = "export", checklist = "default")
database |
Character. The path and name of the existing |
export |
Character. The output path and name where the modified database
files ( |
checklist |
Character. The species checklist to be used. By default, it uses the checklist defined in the database's metadata. |
RvegCombine() operates via a console menu with two primary modes:
Layer Merging (LAYER): Moves all species recorded in one specific layer (e.g., shrub layer 2) into another layer (e.g., tree layer 3).
Species Merging (SPEC): Merges the records of one specific taxon into another across the entire database, which is highly useful for resolving taxonomic aggregates or correcting identification errors after data entry.
Mathematical Consolidation: #' When merging entities that both have non-zero percentage covers in the same relevé, the function does not simply add them together (which could exceed 100%). Instead, it uses a probabilistic sum formula to estimate the combined cover:
Writes two linked CSV files to the location specified by export,
representing the modified Rveg database.
addReleve for data entry, RvegMerge for merging entire databases.
if (interactive()) { RvegCombine( database = file.path(path.package("Rveg"), "extdata/ExampleDB", "example_1") ) }if (interactive()) { RvegCombine( database = file.path(path.package("Rveg"), "extdata/ExampleDB", "example_1") ) }
Reads an existing Rveg database (containing relevé data, header data, and metadata)
into R for analysis. By default, it automatically translates the internal 7-character
ShortName codes back into full botanical names and extracts the layer information.
RvegLoad( database = "default", checklist = "default", customscale = FALSE, variation = 1 )RvegLoad( database = "default", checklist = "default", customscale = FALSE, variation = 1 )
database |
Character. The path and name of the |
checklist |
Character. The species checklist to use for taxonomy translation. By default, the function uses the checklist specified in the database's metadata. |
customscale |
Logical. If |
variation |
Numeric. Determines the format of the returned object ( |
The structure of the imported data is controlled by the variation parameter:
variation = 1 (Default): Returns a single, large data frame. The header data (HEAD) is bound to the top of the species composition data (REL), with new columns added for FullName and layer.
variation = 2: Returns the raw database as a list of three elements: $HeaderDATA, $RelDATA, and $meta (metadata) without any taxonomic translation.
variation = 3: Returns the database as a list of three elements, but $RelDATA is processed to include the translated FullName and layer columns.
Custom Scales: If customscale = TRUE, the function operates interactively. It will pause and prompt the user to manually define percentage replacements for any custom abundance symbols found in the data.
A data frame (if variation = 1) or a list containing data frames and metadata (if variation = 2 or 3).
# Example 1: Load the built-in Rveg database into a single data frame my_data <- RvegLoad() # Example 2: Load the database as a list with separated Header and Releve tables my_list <- RvegLoad(variation = 3)# Example 1: Load the built-in Rveg database into a single data frame my_data <- RvegLoad() # Example 2: Load the database as a list with separated Header and Releve tables my_list <- RvegLoad(variation = 3)
Combines two separate Rveg databases into a single, unified database.
This function cleanly merges both the species composition data (REL) and the
environmental plot header data (HEAD), and seamlessly combines their metadata.
RvegMerge(database_1, database_2, export = "export")RvegMerge(database_1, database_2, export = "export")
database_1 |
Character. The path and name of the first |
database_2 |
Character. The path and name of the second |
export |
Character. The output path and name where the merged database files
( |
During the merge process:
Relevé Re-indexing: The relevé columns from both databases are sequentially re-indexed (e.g., X1, X2, ..., Xn) to prevent column name collisions.
Checklist Validation: The function checks the metadata of both databases to ensure they were built using the same species checklist. If the checklists differ, it will issue a warning, though the merge will still proceed.
Missing Species: If a species exists in one database but not the other, the function automatically fills the absences with 0.
Metadata: The total number of relevés is updated, and any custom species (extra_spec) from both databases are concatenated together.
Writes two linked CSV files to the location specified by export, representing
the combined Rveg database.
RvegCombine for manipulating data within a single database, addReleve for adding individual relevés.
# Example: Merging the built-in database with itself db_path <- file.path(path.package("Rveg"), "extdata/ExampleDB", "example_1") RvegMerge( database_1 = db_path, database_2 = db_path )# Example: Merging the built-in database with itself db_path <- file.path(path.package("Rveg"), "extdata/ExampleDB", "example_1") RvegMerge( database_1 = db_path, database_2 = db_path )
Exports an existing Rveg database into a format directly compatible with
JUICE, a comprehensive software for vegetation classification. This function
processes both the species composition data and the header data, formatting
them to meet JUICE's import requirements.
RvegToJuice(database, export = "export", checklist = "default")RvegToJuice(database, export = "export", checklist = "default")
database |
Character. The path and name of an existing Rveg database
to be exported (e.g., |
export |
name of your exported csv file |
checklist |
Character. The species checklist to use. By default, the function attempts to read the checklist specified in the database's metadata. You can override this by providing a custom file path or a built-in dictionary string. |
To ensure seamless compatibility with JUICE, this function performs several background transformations:
Layer Mapping: Rveg layers are automatically converted to JUICE's numeric layer representations (e.g., Tree layer "3" becomes "2", Shrub "2" becomes "4", Herb "1" becomes "6", etc.).
Absence Encoding: Zero values (0) are converted to ..
Encoding: Files are written using ISO-8859-15 encoding, which is the standard expected by JUICE for proper character rendering.
For JUICE import first import relevé data as Spreadsheet file and follow with Header data as Tab delimineted file.
Writes two text-based CSV files to the location specified by export:
one containing the header data (*H.csv) and one containing the relevé
species data formatted with JUICE headers (*R.csv).
# Example: Exporting the built-in example Rveg database to JUICE format RvegToJuice( database = file.path(path.package("Rveg"), "extdata/ExampleDB", "example_1") )# Example: Exporting the built-in example Rveg database to JUICE format RvegToJuice( database = file.path(path.package("Rveg"), "extdata/ExampleDB", "example_1") )
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.
RvegToTv(database, export = "export", checklist = "default", ver = 3)RvegToTv(database, export = "export", checklist = "default", ver = 3)
database |
Character. The path and name of the existing |
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
|
ver |
Numeric. The target Turboveg version format to export to (either |
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.
Writes one or two CSV files to the location specified by export,
depending on the chosen Turboveg version.
# Example: Exporting the built-in Rveg database to Turboveg v3 format RvegToTv( database = file.path(path.package("Rveg"), "extdata/ExampleDB", "example_1"), ver = 3 )# Example: Exporting the built-in Rveg database to Turboveg v3 format RvegToTv( database = file.path(path.package("Rveg"), "extdata/ExampleDB", "example_1"), ver = 3 )
Converts a Turboveg export file into a fully functional Rveg database.
The function parses plot headers, standardizes species nomenclature against a
specified checklist, and maps vegetation layers.
TvToRveg(tv, export = "export", checklist = "default", Rveglayers = TRUE)TvToRveg(tv, export = "export", checklist = "default", Rveglayers = TRUE)
tv |
Character. The file path to the Turboveg export file ( |
export |
Character. The output path and name of the new |
checklist |
Character. The species checklist used to match Turboveg full
names to Rveg's 7-character |
Rveglayers |
Logical. If |
This function natively supports both .csv and .xml Turboveg export formats.
In Turboveg, either selecet Standard XML file or Spreadsheet table. In the case
of spreadsheet table, select format 'semicolon delimited and requested header data.
During the import process, the function operates interactively:
Species Resolution: If a species in the Turboveg file cannot be automatically matched to the provided checklist, the function will pause and prompt the user to manually resolve the unknown species using a search interface.
Scale Selection: The user will be prompted to specify whether the imported abundance data uses percentages ("P") or the Braun-Blanquet scale ("BB").
Writes two linked CSV files (*REL.csv and *HEAD.csv = Rveg database) to the location
specified by export.
if (interactive()) { # Example: Importing a Turboveg CSV export (or use tvexport.xml) TvToRveg( tv = file.path(path.package("Rveg"), "extdata/ExampleDB", "tvexport.csv"), Rveglayers = TRUE ) }if (interactive()) { # Example: Importing a Turboveg CSV export (or use tvexport.xml) TvToRveg( tv = file.path(path.package("Rveg"), "extdata/ExampleDB", "tvexport.csv"), Rveglayers = TRUE ) }