diff --git a/R/mfairGreedy.R b/R/mfairGreedy.R index 189d6f6..22b9e2e 100644 --- a/R/mfairGreedy.R +++ b/R/mfairGreedy.R @@ -24,9 +24,9 @@ fitGreedy <- function(object, K_max = NULL, sf_para = list()) { # Check whether partially observed main data matrix and record the indices if (object@Y_missing) { - if(object@Y_sparse){ + if (object@Y_sparse) { obs_indices <- NULL # Sparse mode does not need indices - }else{ + } else { obs_indices <- !is.na(object@Y) } } diff --git a/R/mfairInitialization.R b/R/mfairInitialization.R index d33d79a..ae202c1 100644 --- a/R/mfairInitialization.R +++ b/R/mfairInitialization.R @@ -54,7 +54,7 @@ createMFAIR <- function(Y, X, } else { n_missing <- length(Y) - length(Y@x) # Do not store the complete matrix in the sparse mode - if(n_missing == 0){ + if (n_missing == 0) { stop("Please do not store the complete matrix in the sparse mode!") } # End } @@ -158,9 +158,9 @@ initSF <- function(Y, Y_missing, Y_sparse, n_obs) { b_sq <- 1 } - if(Y_sparse){ + if (Y_sparse) { tau <- 2 / var(as.vector(Y@x), na.rm = TRUE) - }else{ + } else { tau <- 2 / var(as.vector(Y), na.rm = TRUE) } beta <- 2 / var(mu)