R/make_design_matrix.R

Defines functions make_design_matrix

make_design_matrix <-
function(geno, names) {
  Nrow = length(geno)
  Ncol = length(names)
  col = match(geno, names)
  frame = data.frame(i = c(1:Nrow), j = col, v = rep(1,Nrow))
  frame = subset(frame, is.na(col) == FALSE)
  L = as.list(frame)
  X = spam::spam(L, nrow = Nrow, ncol = Ncol)
  return(X)
}

Try the SpATS package in your browser

Any scripts or data that you put into this service are public.

SpATS documentation built on Nov. 10, 2022, 5:58 p.m.