Package 'placer'

Title: PLastic ACcumulation Estimate using R (PLACER)
Description: Assessment of the prevalence of plastic debris in bird nests based on bootstrap replicates. The package allows for calculating bootstrapped 95% confidence intervals for the estimated prevalence of debris. Combined with a Bayesian approach, the resampling simulations can be also used to define appropriate sample sizes to detect prevalence of plastics. The method has wide application, and can also be applied to estimate confidence intervals and define sample sizes for the prevalence of plastics ingested by any other organisms. The method is described in Tavares et al. (Submitted).
Authors: Davi Castro-Tavares [cre, aut], Esteban Acevedo-Trejos [aut], Jailson F. Moura [aut]
Maintainer: Davi Castro-Tavares <[email protected]>
License: MIT + file LICENSE
Version: 0.1.3
Built: 2025-01-13 06:43:06 UTC
Source: CRAN

Help Index


Caspian terns plastic debris in Senegal.

Description

A dataset containing absence and presence observations of plastic debris for the Caspian terns in the coast of Senegal.

Usage

ctern

Format

A data frame with 529 rows and 8 variables:

species

species name, add more info

location

location, add more info

country

country, add more info

latitude

latitude, add more info

longitude

longitude, add more info

year

year, add more info

nest_code

nest code, add more info

debris_presence

debris presence absence, add more info

References

Tavares et al. Submitted.


placer: A package to estimate the accumulation of plastic debris in bird's nests

Description

The package placer consist of two main functions to estimate the accumulation of plastic in bird's nest as a function of sample size, and a routine to plot the plastic prevalence probability, and their confidence intervals as a function of sample size.

Main functions

The function plastic.prev.prob calculates the plastic prevalence probability for a given sample size based on presence and absence data The function plastic.ci estimates the 95% confidence intervals for a given prevalence probability of plastic debris. In addition, the package placer includes a plotting routine prevalence_plot to show the estimated plastic prevalence probability and their 95% confidence intervals as a function of sample size.


Confidence intervals of plastic prevalence probability

Description

Bootstrap simulations to estimate 95% bootstrapped CIs for the prevalence of debris obtained with different sample sizes.

Usage

plastic.ci(plastic_abs_pres, max_sample_size = 300, bs_rep = 1000,
  lower_ci = 0.025, upper_ci = 0.975)

Arguments

plastic_abs_pres

numeric vector, containing a binary values with 0 or no for absence of plastic, and 1 or yes for presence of plastic.

max_sample_size

integer, specifying the maximum number of samples to use for estimating the prevalence of plastic debris. By default 300 samples. Increasing sample sizes substantially increases computational time.

bs_rep

integer, specifying the number of bootstrap replications. By default 1000 replications.

lower_ci

numeric, specifying lower confidence interval. By default 2.5%, based on Efron and Tibshirani (1993)

upper_ci

numeric, specifying upper confidence interval. By default 97.5% default, based on Efron and Tibshirani (1993).

Value

A list (cidtf) with a data frame with sample sizes, mean CI, lower CI, upper CI, and a matrix (prevprob) with prevalence probability of plastic debris for all sample sizes and their estimated prevalence of debris.

Note

The confidence intervals are calculated in a sequence of varying sample sizes, i.e. 1,2,3...,n and the function can be also used for defining sample sizes that would provide 95% CIs with the desired accuracy.

References

Efron, B., & Tibshirani, R. (1993). An introduction to the Bootstrap. Boca Raton: Chapman & Hall.

See Also

plastic.prev.prob, prevalence_plot

Examples

plastic.ci(rbinom(1000,1,0.5), 30, 100)

Plastic prevalence probability

Description

plastic.prev.prob estimates the prevalence probability of plastic from a randomly selected sample of absence/presence observations of plastic debris.

Usage

plastic.prev.prob(plastic_abs_pres, num_sample)

Arguments

plastic_abs_pres

numeric vector, containing a binary values with 0 or 'no' for absence of plastic, and 1 or 'yes' for presence of plastic.

num_sample

integer value, specifying the number of samples to randomly draw from the observations.

Value

Prevalence probability of plastic debris in a given sample size.

See Also

plastic.ci, prevalence_plot

Examples

plastic.prev.prob(rbinom(1000,1,0.5), 1)
plastic.prev.prob(rbinom(1000,1,0.5), 10)

Plastic prevalence probability plot

Description

Plot to show the plastic prevalence probability in seabird's nests as a function of different sample sizes and their corresponding confidence intervals.

Usage

prevalence_plot(prev_prob_mat, sample_sizes, lower_ci, upper_ci,
  xlab = "Sample size", ylab = "Plastic prevalence probability",
  colobs = "grey", colci = "#64B5F6")

Arguments

prev_prob_mat

numeric matrix, containing plastic prevalence probability with dimensions (samples_size, bootstrap_replicates).

sample_sizes

numeric vector, containing sequence of sample size used to estimate the confidence intervals plastic.ci.

lower_ci

numeric vector, containing values for lower confidence interval and with the same length as sample_sizes.

upper_ci

numeric vector, containing values for upper confidence interval and with the same length as sample_sizes.

xlab

string, label of x axis.

ylab

string, label of y axis.

colobs

color of observations.

colci

color of confidence intervals.

See Also

plastic.ci, plastic.prev.prob

Examples

binomtest <- plastic.ci(rbinom(1000,1,0.5), 30, 100)
prevalence_plot(binomtest$prevprob,
                binomtest$cidtf$N,
                binomtest$cidtf$lower_ci,
                binomtest$cidtf$upper_ci)