Skip to content

Commit

Permalink
Style the code
Browse files Browse the repository at this point in the history
  • Loading branch information
statwangz committed Sep 19, 2023
1 parent 4a5b74e commit 05eb9c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions R/mfairGreedy.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
6 changes: 3 additions & 3 deletions R/mfairInitialization.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 05eb9c7

Please sign in to comment.