utils.jackknife: Conducts jackknife resampling using a genlight object

View source: R/utils.jackknife.R

utils.jackknifeR Documentation

Conducts jackknife resampling using a genlight object

Description

Jackknife resampling is a statistical procedure where for a dataset of sample size n, subsamples of size n-1 are used to compute a statistic. The collection of the values obtained can be used to evaluate the variability around the point estimate. This function can take the loci, the individuals or the populations as units over which to conduct resampling.

boldNote that when n is very small, jackknife resampling is not recommended.

Parallel computation is implemented. The argument coden.cores indicates the number of core to use. If "auto" [default], it will use all but one available cores. If the number of units is small (e.g. a few populations), there is not real advantage in using parallel computation. On the other hand, if the number of units is large (e.g. thousands of loci), even with parallel computation, this function can be very slow.

Usage

utils.jackknife(
  x,
  FUN,
  unit = "loc",
  recalc = FALSE,
  mono.rm = FALSE,
  n.cores = "auto",
  verbose = NULL,
  ...
)

Arguments

x

Name of the genlight object containing SNP genotypes [required].

FUN

the name of the function to be used to calculate the statistic

unit

The unit to use for resampling. One of c("loc", "ind", "pop"): loci, individuals or populations

recalc

Recalculate the locus metadata statistics [default FALSE].

mono.rm

Remove monomorphic loci [default FALSE].

n.cores

The number of cores to use. If "auto" [default], it will use all but one available cores.

verbose

Verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log; 3, progress and results summary; 5, full report [default 2 or as specified using gl.set.verbosity].

...

any additional arguments to be passed to FUN

Value

A list of length n where each element is the output of FUN

Author(s)

Custodian: Carlo Pacioni – Post to https://groups.google.com/d/forum/dartr

Examples

require("dartR.data")
platMod.gl <- gl.filter.allna(platypus.gl) 
chk.pop <- utils.jackknife(x=platMod.gl, FUN="gl.alf", unit="pop", 
recalc = FALSE, mono.rm = FALSE, n.cores = 1, verbose=0)

dartR documentation built on June 8, 2023, 6:48 a.m.