Skip to content

Commit

Permalink
revert #350
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Nov 25, 2020
1 parent 83fd175 commit abc447c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion R/get_scores.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#' @export
get_scores <- function(x, n_items = NULL) {
subscales <- closest_component(x)
data_set <- attributes(x)$data
data_set <- attributes(x)$data_set

out <- lapply(sort(unique(subscales)), function(.subscale) {
columns <- names(subscales)[subscales == .subscale]
Expand Down
6 changes: 3 additions & 3 deletions R/principal_components.R
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ principal_components.data.frame <- function(x, n = "auto", rotation = "none", so
# Rotation
if (rotation != "none") {
loadings <- .pca_rotate(x, n, rotation = rotation, sort = sort, threshold = threshold, original_data = original_data, ...)
attr(loadings, "data_name") <- data_name
attr(loadings, "data") <- attr(loadings, "data_name") <- data_name
return(loadings)
}

Expand Down Expand Up @@ -196,8 +196,8 @@ principal_components.data.frame <- function(x, n = "auto", rotation = "none", so
# for each variable, so we know which column in the original data set belongs
# to which extracted component...
attr(loadings, "closest_component") <- .closest_component(loadings, loadings_columns = loading_cols, variable_names = colnames(x))
attr(loadings, "data_name") <- data_name
attr(loadings, "data") <- attr(loadings, "data_set") <- original_data
attr(loadings, "data") <- attr(loadings, "data_name") <- data_name
attr(loadings, "data_set") <- original_data

# add class-attribute for printing
class(loadings) <- unique(c("parameters_pca", "see_parameters_pca", class(loadings)))
Expand Down

0 comments on commit abc447c

Please sign in to comment.