combine_posteriors: Combining species level posteriors for group level analyses

Description Usage Arguments References Examples

View source: R/Combine_posteriors.r

Description

This takes the individual posterior sample files for each species from a directory where these have been downloaded from the associated EIDC reposotory and combines them for the group level analyses presented within the associated paper.

Usage

1
combine_posteriors(group_level, datadir, outdir, status = TRUE)

Arguments

group_level

A character string of either "taxa" or "major_group" depending on analysis level of interest. Selecting "major_group" will also produce a combined posterior file for all species so that change across all species can be calculated later.

datadir

A filepath specifying where the repository downloads are saved. POSTERIOR_SAMPLES subfolder must be within this directory.

outdir

A filepath specifying where the combined posterior outputs are to be saved.

status

Logical. If TRUE then the status of the function will be printed to the console. This specifies where in each group the function is up to in number of species out of the total number of species. e.g. 1 of 29 for the first ant species. Default is TRUE

References

Outhwaite et al (in prep) Complexity of biodiversity change revealed through long-term trends of invertebrates, bryophytes and lichens.

Outhwaite, C. L., Powney, G. D., August, T. A., Chandler, R. E., Rorke, S., Pescott, O., … Isaac, N. J. B. (2019). Annual estimates of occupancy for bryophytes, lichens and invertebrates in the UK (1970-2015). NERC Environmental Information Data Centre. https://doi.org/10.5285/0ec7e549-57d4-4e2d-b2d3-2199e1578d84

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 

# Run combine_posteriors function for taxa level analyses.
combine_posteriors(group_level = "taxa",
datadir = paste0(getwd(), "/Repository downloads"),
outdir = paste0(getwd(), "/Outputs"),
status = TRUE)

#' # Run combine_posteriors function for major group level analyses.
combine_posteriors(group_level = "major_group",
datadir = paste0(getwd(), "/Repository downloads"),
outdir = paste0(getwd(), "/Outputs"),
status = TRUE)


## End(Not run)

CharlieOuthwaite/UKBiodiversity documentation built on Jan. 24, 2020, 12:45 p.m.