Import Vernacular

Import Vernacular using the OpenDataBio R package
library(opendatabio)
base_url="http://localhost/opendatabio/api"
token="YOUR TOKEN HERE"
cfg = odb_config(base_url=base_url, token = token)
odb_test(cfg)

#generate fake data for testing
name = c('pau rosa',"casca preciosa")
taxons = c("Aniba roseaodora,Aniba panurensis,Aniba parvifolia","Aniba canelilla")

#get the id of some individuals
inds = odb_get_individuals(params=list(taxon="Aniba roseaodora,Aniba panurensis,Aniba parvifolia",fields='id,scientificName',limit=10),odb_cfg = cfg)
individuals=c(paste(inds$id,collapse = ","),NA)

#idiomas = odb_get_languages(odb_cfg = cfg)
language= c('pt-br','en') 

#create a data.frame with this information
verna = data.frame(name,taxons,language,taxons,individuals)

#citations (just generate a data.frame for each vernacular)
umaCitatcao = data.frame(
    citation='This would be the cited text', 
    bibreference="Riberiroetal1999FloraDucke", #bibkey or the id
    type='generic', #can be: generic, use, etymology
    notes='my observations about this citation')

#add a list-type column
verna$citations = list(oneCitation,NA)

#import to opendatabio
odb_import_vernaculars(verna,odb_cfg = cfg)