db_annotate: Insert new annotation

Description Usage Arguments Details Value Examples

View source: R/db_annotate.R

Description

Insert new annotation

Usage

1
2
db_annotate(db, object, annotationtext = NULL, type = "Site group",
  annotationcode = NULL)

Arguments

db

database connecton object

object

An existing object in the database to annotate such as a site or specimen code.

annotationtext

Text of annotation

type

annotation type from controlled vocab

annotationcode

Optionally, a unique codename for the annotation

Details

This function adds an existing annotation to an existing feature in the database such as a site code, sampling feature, or action. Once objects are annotated, they can be more easily queried as a group based on these labels or tags that are not otherwise represented in the database structure. Either an annotation code or annotation text must be provided to identify the annotation

Value

TRUE if successful

Examples

1
2
3
4
db <- rodm2::create_sqlite(connect = TRUE)
db_describe_annotation(db, annotationtypecv = "Site group", annotationtext = "Riparian wells")
db_describe_site(db, site_code = "Site 001")
db_annotate(db, object = "Site 001", annotationtext = "Riparian wells")

khondula/rodm2 documentation built on Jan. 9, 2020, 1:48 p.m.