bioacoustica.postTrait: Post trait data to BioAcoustica

Description Usage Arguments Author(s) Examples

Description

A function to post bioacoustic traits to BioAcoustica.

Usage

1
bioacoustica.postTrait(taxon_name, c, call_type="", trait="", value="", temp="", sex="", annotation_id="", inference_notes="", cascade=0)

Arguments

taxon_name

Thetaxonomic name of the species the trait belongs to.

c

An authenticated CURL handle.

call_type

The type of call the trait applies to (e.g. calling song, rivalry song).

trait

The name of the trait being submitted.

value

The value of the trait being submitted.

temp

The temperature at which the trait was recorded.

sex

The sex of the individual the trait applies to.

annotation_id

The annotation ID used to calculate this trait, if applicable.

inference_notes

String describing how the trait was infered, if applicable.

cascade

If set to 1 the BioAcoustica inference bot will aplly this trait to child taxa of this taxon.

Author(s)

Ed Baker

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function(taxon_name, c, call_type=NULL, trait=NULL, value=NULL, temp=NULL, sex=NULL, inference_notes=NULL, cascade=0){
  pars=list(
    "group_audience[und][]"=2,
    "group_content_access[und]"=2,
    "field_taxonomic_name[und]"=taxon_name,
    "field_bioacoustic_traits[und][0][field_call_type][und][0][value]"=call_type,
    "field_bioacoustic_traits[und][0][field_trait][und]"=trait,
    "field_bioacoustic_traits[und][0][field_value][und][0][value]"=value,
    "field_bioacoustic_traits[und][0][field_temperature][und][0][value]"=temp,
    "field_bioacoustic_traits[und][0][field_sex_trait][und][0][value]"=sex,
    "field_inference_notes[und][0][value]"=inference_notes
  )
  if (cascade==1) {
    pars <-c(pars, "field_bioacoustic_traits[und][0][field_cascade_down][und]"=1)
  }
  DrupalR::drupalr.postForm("bio.acousti.ca", "/node/add/bioacoustic-traits", "bioacoustic-traits-node-form", pars=pars, c)
}

BioAcoustica/bioacousticaR documentation built on May 5, 2019, 3:46 p.m.