Skip to content

Commit 4621eda

Browse files
hidekojiclaude
andcommitted
fix(tam#37340): rename the Selected column to Adoption
Its cells are 'Adopted' / 'Not Adopted', so a 'Selected' header (what PCA's older variances_judged calls it) does not agree with its own values in the English report. Japanese renders 採否 / 採用 / 非採用 either way. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent ff62bb8 commit 4621eda

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

R/factanal.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,10 @@ tidy.fa_exploratory <- function(x, type="loadings", n_sample=NULL, pretty.name=F
835835
`Cummulated % Variance` = cumsum(pct_variance),
836836
`Parallel Analysis` = parallel_label,
837837
`Kaiser Criterion` = ifelse(kaiser_adopted, "Adopted", "Not Adopted"),
838-
Selected = ifelse(selected_adopted, "Adopted", "Not Adopted"),
838+
# Column name "Adoption", not PCA's "Selected": the cells read "Adopted" / "Not Adopted", so a
839+
# "Selected" header would not agree with its own values in the English report. Both map to
840+
# 採否 / 採用 / 非採用 in Japanese. (tam#37340)
841+
Adoption = ifelse(selected_adopted, "Adopted", "Not Adopted"),
839842
parallel_status = parallel_status,
840843
kaiser_status = ifelse(kaiser_adopted, "adopted", "not_adopted"),
841844
selected_status = ifelse(selected_adopted, "adopted", "not_adopted")

tests/testthat/test_factanal.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ test_that("report part 3: variances_judged, suitability P value format, analysis
360360
judged <- tidy(fit, type = "variances_judged")
361361
expect_equal(colnames(judged),
362362
c("Factor", "Eigenvalue", "% Variance", "Cummulated % Variance",
363-
"Parallel Analysis", "Kaiser Criterion", "Selected",
363+
"Parallel Analysis", "Kaiser Criterion", "Adoption",
364364
"parallel_status", "kaiser_status", "selected_status"))
365365
n_var <- length(fit$communality)
366366
expect_equal(nrow(judged), n_var)
@@ -377,7 +377,7 @@ test_that("report part 3: variances_judged, suitability P value format, analysis
377377
expect_false(any(judged$kaiser_status == "na"))
378378
# Selected = the factors this analysis actually extracted (nfactors), first rows only.
379379
expect_equal(judged$selected_status, ifelse(seq_len(n_var) <= 2, "adopted", "not_adopted"))
380-
expect_equal(judged$Selected, ifelse(seq_len(n_var) <= 2, "Adopted", "Not Adopted"))
380+
expect_equal(judged$Adoption, ifelse(seq_len(n_var) <= 2, "Adopted", "Not Adopted"))
381381
# Labels stay English-canonical; the client translates them. "Adopted" (not PCA's "Adopt") so the
382382
# English report reads as a judgment against "Not Adopted".
383383
expect_true(all(judged$`Parallel Analysis` %in% c("Adopted", "Not Adopted", "Not Available")))

0 commit comments

Comments
 (0)