gl.load: Loads an object from compressed binary format produced by...

View source: R/gl.load.r

gl.loadR Documentation

Loads an object from compressed binary format produced by gl.save()

Description

This is a wrapper for readRDS() The function reads the object from the nominated file, checks if it is a dartR genlight object, converts it if it is not, and returns the gl object. A compliance check can be requested.

Objects of class dartR saved by the legacy dartR package are converted to dartR.base objects without loading the legacy package (which would mask the dartR.base functions), and also when it is not installed. A file-backed (FBM) object saved with saveRDS() instead of gl.save() can only be loaded while its backing file (.bk) exists; otherwise gl.load() stops with an error.

Usage

gl.load(file, fbm = FALSE, compliance = FALSE, verbose = NULL)

Arguments

file

Name of the file from which to read the saved object [required].

fbm

Whether to convert dartR-gen object to dartR-fbm object [default FALSE].

compliance

Whether to undertake a compliance check [default FALSE].

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].

Value

The loaded object, returned invisibly

Author(s)

Author(s): Arthur Georges. Custodian: Arthur Georges – Post to https://groups.google.com/d/forum/dartr

See Also

gl.save

Other io: gl.read.PLINK(), gl.read.csv(), gl.read.dart(), gl.read.fasta(), gl.read.silicodart(), gl.save(), gl.write.csv(), utils.read.dart()

Examples

f <- file.path(tempdir(), 'testset.rds')
gl.save(testset.gl, f)
gl <- gl.load(f)


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