some species have very little data and would be discarded of they were modelled on their own. New functionality allows for modelling any specified species jointly as part of a functional group. It works by changing the species name in the data file to the name of the functional group.
data/external/focalTaxa.csv now has an additional column called "functionalGroup", for any taxa where functionalGroup remains unspecified will be modelled independently as usual. Any rows where "functionalGroup" is specified will have scientific name of those species changed to the string specified under "functionalGroup". In effect, all species with the same taxonomic group (i.e., "taxa" column) and of the same "functionalGroup" will be modelled as one species.
The code also allows for species to be modelled simultaneously and as part of any number of functional groups by repeating the row and having different values under "functionalGroup". e.g., a specialist species may be included in a model on its own, with similar specialist species, and with generalist species by repeating the row for that species three times in data/external/focalTaxa.csv and specifying under functionalGroup "specialistA", "generalist", and "" (ie. left blank).
functions/joinFunctionalGroups.R - function that will rename species in each dataset of each taxa by the functional group. Function also replicates records for species to be modelled as part of multiple functional groups. Function also retains the original "acceptedScientificName" under column "scientificName" for reference.
functions/modelPreparation.R - add section that will check if any species are to be modelled as part of a functional group and change their species name accordingly.
getScientificName.R - new function to get gbif scientific name for a specified taxonomic key
pipeline/import/taxaImport.R - get missing usageKey (eg if only supplying species names in focalTaxa.csv) filters only "included"species before saving to dateAccessed folder.
pipeline/integration/utils/metadataProduction.Rmd - add plots for observed data with grouping by functional group.
functions/processANOData.R, functions/processFieldNotes.R, functions/processFieldNotesEvent.R, functions/processNationalinsectmonitoringinNorway.R, pipeline/integration/speciesDataProcessing.R, pipeline/integration/utils/defineProcessing.R - add retention of "taxonKeyProject" (usage key requested from gbif that yielded the observation data), which is used to crossreference species with focalTaxa.csv to indentify species to be modelled jointly as single functionalGroup
Why have changes been made?
some species have very little data and would be discarded of they were modelled on their own. New functionality allows for modelling any specified species jointly as part of a functional group. It works by changing the species name in the data file to the name of the functional group. data/external/focalTaxa.csv now has an additional column called "functionalGroup", for any taxa where functionalGroup remains unspecified will be modelled independently as usual. Any rows where "functionalGroup" is specified will have scientific name of those species changed to the string specified under "functionalGroup". In effect, all species with the same taxonomic group (i.e., "taxa" column) and of the same "functionalGroup" will be modelled as one species. The code also allows for species to be modelled simultaneously and as part of any number of functional groups by repeating the row and having different values under "functionalGroup". e.g., a specialist species may be included in a model on its own, with similar specialist species, and with generalist species by repeating the row for that species three times in data/external/focalTaxa.csv and specifying under functionalGroup "specialistA", "generalist", and "" (ie. left blank).
What changes have been made?