diff --git a/NAMESPACE b/NAMESPACE index da391da..ee9f374 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -16,6 +16,7 @@ export(updateMFAIR) exportClasses(MFAIR) exportClasses(MFAIRSingleFactor) exportMethods(predict) +import(Matrix) importFrom(dplyr,left_join) importFrom(methods,new) importFrom(rpart,rpart) diff --git a/R/mfairObject.R b/R/mfairObject.R index f8852d2..ee17fef 100644 --- a/R/mfairObject.R +++ b/R/mfairObject.R @@ -1,5 +1,13 @@ -#' Each MFAIR object has a number of slots which store information. Key slots to access are listed below. +#' Define the matrixORdgCMatrix class as the union of matrix and Matrix::dgCMatrix +#' +#' @import Matrix #' +setClassUnion( + name = "matrixORdgCMatrix", + members = c("matrix", "dgCMatrix") +) + +#' Each MFAIR object has a number of slots which store information. Key slots to access are listed below. #' #' @slot Y A matrix or Matrix::dgCMatrix. The main data matrix of N samples and M features. #' @slot X A data.frame. The auxiliary information data frame of N samples and C covariates. diff --git a/R/mfairUtils.R b/R/mfairUtils.R deleted file mode 100644 index 8e8d029..0000000 --- a/R/mfairUtils.R +++ /dev/null @@ -1,4 +0,0 @@ -#' Defined the matrixORdgCMatrix class as the union of matrix and Matrix::dgCMatrix -#' @importFrom Matrix dgCMatrix -#' -setClassUnion(name = "matrixORdgCMatrix", members = c("matrix", "dgCMatrix")) diff --git a/man/MFAIR-class.Rd b/man/MFAIR-class.Rd index 73ea1eb..2b17008 100644 --- a/man/MFAIR-class.Rd +++ b/man/MFAIR-class.Rd @@ -13,10 +13,12 @@ Each MFAIR object has a number of slots which store information. Key slots to ac \section{Slots}{ \describe{ -\item{\code{Y}}{A matrix. The main data matrix of N samples and M features.} +\item{\code{Y}}{A matrix or Matrix::dgCMatrix. The main data matrix of N samples and M features.} \item{\code{X}}{A data.frame. The auxiliary information data frame of N samples and C covariates.} +\item{\code{Y_sparse}}{Logical. Whether the main data matrix Y is stored in the sparse mode.} + \item{\code{Y_center}}{Logical. Whether the main data matrix Y is centered.} \item{\code{Y_mean}}{Numeric. Mean of the main data matrix Y if centered. Zero if not.} diff --git a/man/createMFAIR.Rd b/man/createMFAIR.Rd index d795cbf..6af2ff0 100644 --- a/man/createMFAIR.Rd +++ b/man/createMFAIR.Rd @@ -7,7 +7,7 @@ createMFAIR(Y, X, Y_center = TRUE, K_max = 1L, project = "MFAIR") } \arguments{ -\item{Y}{A matrix. The main data matrix of N samples and M features.} +\item{Y}{A matrix or Matrix::dgCMatrix. The main data matrix of N samples and M features.} \item{X}{A data.frame. The auxiliary information data frame of N samples and C covariates.} diff --git a/man/matrixORdgCMatrix-class.Rd b/man/matrixORdgCMatrix-class.Rd new file mode 100644 index 0000000..625af45 --- /dev/null +++ b/man/matrixORdgCMatrix-class.Rd @@ -0,0 +1,9 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/mfairObject.R +\docType{class} +\name{matrixORdgCMatrix-class} +\alias{matrixORdgCMatrix-class} +\title{Define the matrixORdgCMatrix class as the union of matrix and Matrix::dgCMatrix} +\description{ +Define the matrixORdgCMatrix class as the union of matrix and Matrix::dgCMatrix +}