refdb_set_fields: Associate columns to fields

View source: R/fields.R

refdb_set_fieldsR Documentation

Associate columns to fields

Description

Associate columns to fields so they are recognized and appropriately treated by refdb functions.

Usage

refdb_set_fields(
  x,
  source = NA,
  id = NA,
  organism = NA,
  taxonomy = NA,
  sequence = NA,
  marker = NA,
  latitude = NA,
  longitude = NA,
  reference = NA,
  config_yaml = NULL
)

Arguments

x

a reference database (tibble).

source

name of the column which contains the data source.

id

name of the column which contains the record IDs.

organism

name of the column which contains the names of the organisms.

taxonomy

a vector of column names.

sequence

name of the column which contains the sequences.

marker

name of the column which contains marker names.

latitude

name of the column which contains latitudes (WGS 84)

longitude

name of the column which contains longitudes (WGS 84).

reference

a vector of column names.

config_yaml

a file path to a YAML file

Details

Taxonomy reordering. NA to ignore, NULL to delete. Fields set using config_yaml always overwrite those set by arguments

Value

The function returns x with updated attributes.

Examples

lib <- read.csv(system.file("extdata", "ephem.csv", package = "refdb"))
lib <- refdb_set_fields(lib,
                        taxonomy = c(family = "family_name",
                            genus = "genus_name",
                            species = "species_name"),
                        sequence = "DNA_seq",
                        marker = "marker")


refdb documentation built on Sept. 22, 2022, 5:07 p.m.