Learn R Programming

Rveg (version 0.1.8)

RvegLoad: RvegLoad: Load an Rveg Database into the R Environment

Description

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.

Usage

RvegLoad(
  database = "default",
  checklist = "default",
  customscale = FALSE,
  variation = 1
)

Value

A data frame (if variation = 1) or a list containing data frames and metadata (if variation = 2 or 3).

Arguments

database

Character. The path and name of the Rveg database to load (e.g., "path/to/my_db"). Defaults to "default", which loads the package's built-in example database.

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 TRUE, launches an interactive prompt to convert custom abundance scales into numeric percentages. Defaults to FALSE.

variation

Numeric. Determines the format of the returned object (1, 2, or 3). Defaults to 1.

Details

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.

Examples

Run this code
# 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)

Run the code above in your browser using DataLab