| gl.save | R Documentation |
This is a wrapper for saveRDS(). The script saves the object in compressed binary form to the nominated file and returns the input gl object unchanged.
Only the object is saved, not the workspace. A file-backed (FBM) object is saved as a gen-backed copy (genotypes in @gen): an FBM holds only a reference to its backing file, which is usually temporary, and the gen-backed copy is also smaller. The input object stays file-backed. Use gl.load(file, fbm = TRUE) to load it back as a file-backed object.
**Always use gl.save(), not saveRDS(), for a file-backed object.** saveRDS() stores only the reference to the backing file, not the genotypes; the backing file is usually a temporary file that is deleted at the end of the R session, so the genotypes are lost. After saving, check that the file size makes sense for the number of individuals and loci: a file of only a few Kb for thousands of loci means the genotypes were not saved. gl.save() reports the size of the saved file at verbose >= 2.
gl.save(x, file, verbose = NULL)
x |
Name of the genlight object containing SNP genotypes [required]. |
file |
Name of the file to receive the binary version of the object [required]. |
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]. |
The input object, returned invisibly
Author(s): Arthur Georges. Custodian: Arthur Georges – Post to https://groups.google.com/d/forum/dartr
gl.load
Other io:
gl.load(),
gl.read.PLINK(),
gl.read.csv(),
gl.read.dart(),
gl.read.fasta(),
gl.read.silicodart(),
gl.write.csv(),
utils.read.dart()
gl.save(testset.gl,file.path(tempdir(),'testset.rds'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.