symerge: Synonyms merge

View source: R/dbgroups_AVES.R

symergeR Documentation

Synonyms merge

Description

Synonyms merge

Usage

symerge(ttax, tdata, sy, clean = TRUE)

Arguments

ttax

table containing the taxonomy we wish to keep.

tdata

table containing the data to add to ttax.

sy

the synonyms table. A table with two columns (scinam, syid), see examples.

clean

default to TRUE; remove scinam_tdata, .pk and renames scinam_ttax to scinam

Examples

ttax  = data.table(scinam = c('a', 'b', 'c', 'd', 'm', 'n'), V1 = rnorm(6))
tdata  = data.table(scinam = c('a', 'b', 'j', 'k', 'n', 'm'), V2 = rnorm(6))
sy = data.table(scinam = c('a', 'b', 'c', 'j', 'd', 'k', 'm', 'n'), syid = c(1,2,3,3,4,4,5,5))
symerge(ttax, tdata, sy)
############
require(sdb)   
tdata = dbq(user ='mihai', q = 'select * from AVES_lifeHistory.sociality')
ttax = dbq(user ='mihai', q = 'select scinam, prop_epp_young from AVES_lifeHistory.promiscuity_v2')
sy = dbq(user = 'mihai', q= 'select scinam, syid from  AVES_taxonomy.synonyms_v2')

x = symerge(ttax, tdata, sy)

mpio-be/sdb documentation built on Nov. 18, 2022, 12:24 a.m.