rbind.dartR: rbind for dartR objects

View source: R/utils.dartR.class.def.r

rbind.dartRR Documentation

rbind for dartR objects

Description

Combines the individuals of two or more dartR objects that hold the same loci. Loci are matched by name, so the objects may list them in different orders; the result follows the locus order of the first object.

Metadata are carried over: locus metrics come from the first object; individual metrics are stacked (a column missing from an object is filled with NA), and so are coordinates in latlon when every object has them; the locus-metric flags are reset to FALSE, because metrics such as call rate and allele frequencies no longer describe the combined set of individuals (use gl.recalc.metrics to recompute them); the call is added to the history of the first object.

The function stops when the objects hold different loci, code the alleles of a locus differently (loc.all), or mix SNP (ploidy 2) and SilicoDArT (ploidy 1) data. To combine a list of objects, use do.call(rbind, list_of_objects).

Usage

## S3 method for class 'dartR'
rbind(..., backingfile = NULL, code = NULL, chunk = 2048L, quiet = TRUE)

Arguments

...

dartR objects to combine [required]

backingfile

File stem for the backing file of the resulting FBM, or NULL for a temporary file in getOption("FBM.dir") [default NULL]

code

code mapping to use for the resulting FBM=CODE_012; if NULL, inherits from the first FBM input

chunk

number of columns to process in a block when copying from FBMs

quiet

suppress warnings. default: TRUE

Value

A dartR object

Examples

t1 <- platypus.gl
t2 <- rbind(t1[1:5,],t1[6:10,])
# a list of objects
t3 <- do.call(rbind, list(t1[1:5,], t1[6:10,], t1[11:15,]))

dartR.base documentation built on Nov. 18, 2026, 9:06 a.m.