Skip to content

Commit

Permalink
try Joris changes
Browse files Browse the repository at this point in the history
  • Loading branch information
juliuspfadt committed May 7, 2024
1 parent a934682 commit 61b3577
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions R/principalcomponentanalysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -646,22 +646,20 @@ principalComponentAnalysisInternal <- function(jaspResults, dataset, options, ..

scores <- modelContainer[["model"]][["object"]][["scores"]]
baseNames <- gettextf("Component_%s", seq_len(ncol(scores)))
encodedNames <- jaspBase::createColumns(baseNames)
# encodedNames <- jaspBase::createColumns(baseNames)

# print(length(container[[""]]))
if (length(encodedNames) == length(baseNames)) {
# if (length(encodedNames) == length(baseNames)) {
for (i in seq_len(ncol(scores))) {
container[[encodedNames[i]]] <- jaspBase::createJaspColumn(encodedNames[i])
container[[encodedNames[i]]]$setScale(scores[, i])
container[[baseNames[i]]] <- jaspBase::createJaspColumn(baseNames[i])
container[[baseNames[i]]]$setScale(scores[, i])
}
jaspResults[["addedScoresContainer"]] <- container

} else {
container <- NULL
jaspResults[["addedScoresContainer"]] <- NULL
}


# } else {
# container <- NULL
# jaspResults[["addedScoresContainer"]] <- NULL
# }

return()

Expand Down

0 comments on commit 61b3577

Please sign in to comment.