Learn R Programming

plmmr (version 4.3.0)

subset_filebacked: A helper function to subset big.matrix objects

Description

A helper function to subset big.matrix objects

Usage

subset_filebacked(X, new_file, complete_samples, ns, rds_dir, outfile, quiet)

Value

A list with two components. First, a big.matrix object, subset_X, representing a design matrix wherein:

  • rows are subset to those with complete phenotype information

  • columns are subset so that no constant features remain -- this is important for standardization downstream

The list also includes the integer vector ns which marks which columns of the original matrix were 'non-singular' (i.e. not constant features). The ns index plays an important role in plmm_format() and untransform()

Arguments

X

A filebacked big.matrix with the to-be-standardized design matrix

new_file

Optional user-specified new file for the to-be-created .rds/.bk files.

complete_samples

Numeric vector with indices marking the rows of the original data which have a non-missing entry in the 6th column of the .fam file

ns

Numeric vector with the indices of the non-singular columns

rds_dir

The path to the directory in which you want to create the new .rds and .bk files. Defaults to data_dir

outfile

Optional: the name (character string) of the logfile to be written.

quiet

Logical: should console messages be silenced? Defaults to FALSE