Skip to contents

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

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

Examples

require("dartR.data")
platMod.gl <- gl.filter.allna(platypus.gl) 
#> Starting gl.filter.allna 
#>   Processing genlight object with SNP data
#>   Identifying and removing loci and individuals scored all 
#>                 missing (NA)
#>   Deleting loci that are scored as all missing (NA)
#>   Deleted
#>   Deleting individuals that are scored as all missing (NA)
#> Completed: gl.filter.allna 
#> 
chk.pop <- utils.jackknife(x=platMod.gl, FUN="gl.alf", unit="pop", 
recalc = FALSE, mono.rm = FALSE, n.cores = 1, verbose=0)
#> Starting gl.set.verbosity 
#>   Global verbosity set to: 2 
#> Completed: gl.set.verbosity 
#> Starting gl.set.verbosity 
#>   Global verbosity set to: 2 
#> Completed: gl.set.verbosity 
#> Starting gl.set.verbosity 
#>   Global verbosity set to: 2 
#> Completed: gl.set.verbosity 
#>