Skip to content

Commit 80ef0a8

Browse files
committedMay 11, 2024·
reformatting
1 parent 0fb8ebc commit 80ef0a8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed
 

‎R/makeCorrAlpha.R

+7-3
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ makeCorrAlpha <- function(items, alpha, variance = 0.5, precision = 0) {
172172
}
173173

174174
is_positive_definite <- min(best_eigen_values) >= 0
175+
175176
if (is_positive_definite) {
176177
cat(paste0("stopped at swap - ", r, "\n"))
177178
break
@@ -184,8 +185,12 @@ makeCorrAlpha <- function(items, alpha, variance = 0.5, precision = 0) {
184185

185186
k <- items
186187

187-
if (precision < 0) {precision <- 0 }
188-
if (precision > 3) {precision <- 3 }
188+
if (precision < 0) {
189+
precision <- 0
190+
}
191+
if (precision > 3) {
192+
precision <- 3
193+
}
189194

190195

191196
## Calculate the mean correlation coefficient from alpha
@@ -259,4 +264,3 @@ makeCorrAlpha <- function(items, alpha, variance = 0.5, precision = 0) {
259264

260265
return(cor_matrix)
261266
} ## end matrixFromAlpha function
262-

0 commit comments

Comments
 (0)
Please sign in to comment.