getPlantNames: getPlantNames

getPlantNamesR Documentation

getPlantNames

Description

Translates between Latin names, common names and TSN numbers.

Usage

getPlantNames(
  object,
  names,
  out.style = "common",
  in.style = "Latin",
  output = "vector"
)

Arguments

object

An NPSForVeg object

names

a character vector of Latin names, common names or TSN numbers (as a character vector) to be translated, or when list of NPSForVeg objects is passed to object, a list of plant names can be passes to names. See details below.

out.style

Either "common", "Latin", or "TSN". Indicates the type of name that should be returned. Defaults to "common"

in.style

Either "common", "Latin", or "TSN". Indicates the type of name found in the "names" argument.

output

Accepts "vector" or "list". Determines the output type When object is a list. When implemented "list" will return a list where each element of the list is a data.frame from a single NPSForVeg object, and each element is named based on that object's ParkCode slot.

Details

This function will convert the names in names to the style specified in out.style, using the data in the Commons slot of an object of class NPSForVeg. Note that if the data in the Commons slot has more than one entry for one or more of the input names, or is not present, the funciton will fail with an error.

If the object is a list, then the names can be a list as well. If so then then each element in the list of objects will be matched with the corresponding element in the list of names, and getPlantNames will be run. When output is "vector" the resuting character vectors will be concatenated using unlist. When output is "list" the the output will be a list with each element being a character vector of names.

The function will not accept a list of names when the object is a data.frame or an NPSForVeg object.

Value

A character vector or list of names in the format specified by out.style.


NCRN/NPSForVeg documentation built on March 26, 2024, 7:13 a.m.