R/Dat.R

Defines functions Dat

#' @importFrom methods new
Dat.builder <- setRefClass("Dat", fields = c("Y", "meta", "missing.ind"),
                           methods = list(
                             getY = function() {
                               return(.self$Y)
                             },
                             productY = function(x) {
                               .self$Y %*% x
                             },
                             productYt = function(x) {
                               crossprod(.self$Y, x)
                             }
                           )
                           )

# Class which store data
Dat <- function(Y) {
  dat <- Dat.builder(Y = read_input(Y),
                     meta = list(),
                     missing.ind = NULL)
  dat$missing.ind <- which(is.na(dat$Y))
  dat
}

Try the lfmm package in your browser

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

lfmm documentation built on June 30, 2021, 5:07 p.m.