snp_attach: Attach a "bigSNP" from backing files

View source: R/read-plink.R

snp_attachR Documentation

Attach a "bigSNP" from backing files

Description

Load a bigSNP from backing files into R.

Usage

snp_attach(rdsfile)

Arguments

rdsfile

The path of the ".rds" which stores the bigSNP object.

Details

This is often just a call to readRDS. But it also checks if you have moved the two (".bk" and ".rds") backing files to another directory.

Value

The bigSNP object.

Examples

(bedfile <- system.file("extdata", "example.bed", package = "bigsnpr"))

# Reading the bedfile and storing the data in temporary directory
rds <- snp_readBed(bedfile, backingfile = tempfile())

# Loading the data from backing files
test <- snp_attach(rds)

str(test)
dim(G <- test$genotypes)
G[1:8, 1:8]

privefl/bigsnpr documentation built on April 3, 2024, 7:18 p.m.