Cross-product between a "bed" object and a vector.

Missing values are replaced by 0 (after centering), as if they had been imputed using parameter center.

bed_cprodVec(
  obj.bed,
  y.row,
  ind.row = rows_along(obj.bed),
  ind.col = cols_along(obj.bed),
  center = rep(0, length(ind.col)),
  scale = rep(1, length(ind.col))
)

Arguments

obj.bed

A bed object.

y.row

A vector of same size as ind.row.

ind.row

An optional vector of the row indices that are used. If not specified, all rows are used. Don't use negative indices.

ind.col

An optional vector of the column indices that are used. If not specified, all columns are used. Don't use negative indices.

center

Vector of same length of ind.col to subtract from columns of X.

scale

Vector of same length of ind.col to divide from columns of X.

Value

\(X^T \cdot y\).

Examples

bedfile <- system.file("extdata", "example.bed", package = "bigsnpr") obj.bed <- bed(bedfile) y.row <- rep(1, nrow(obj.bed)) str(bed_cprodVec(obj.bed, y.row))
#> num [1:4542] 354 213 245 191 472 368 132 497 498 481 ...