pipe: Add relationships to related features table

Description Usage Arguments Details Value Examples

Description

Add relationships to related features table

Usage

1
2
3
db_add_relations(db, edgelist, from_column = "SamplingFeatureCode",
  to_column = "RelatedFeatureCode", relationtype_column = NULL,
  relationtype = "isChildOf")

Arguments

db

database connection object.

edgelist

dataframe with new relationships to add. see details

from_column

name of first column with feature codes to relate

to_column

name of second column with feature codes to relate

relationtype_column

name of column with relationship type from controlled vocabulary

relationtype

relationship type to use if no relationship type column. defaults to "isChildOf"

Details

Edgelist should be a data frame with 3 columns and one row for each new relationship to establish with the features to connect and the type of relationship. Specify the names of columns corresponding to the features using the 'from_column' and 'to_column' arguments, and the name of the column with relationship types with 'relationtype_column'. A two column data frame can be supplied along with a relationtype to use for all of the new relationships. Site codes must already be in database.

Value

message with how many rows added

Examples

1
2
3
4
# df <- data.frame(
# "SamplingFeatureCode" = "subsite1",
# "RelatedFeatureCode" = "site1")
# db_add_relation(db, edgelist = df)

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