cor_text() errors for Kendall correlations
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
Research direction
Start in R/cor_text.R and inspect the z branch that reads table$z; the issue says it should read from x. Reproduce the failure with the Kendall examples in the issue, then check the output for both cor_test() and correlation(). Done means cor_text() returns the expected text with the statistic; the issue also raises whether the exact Kendall statistic should be labeled T.
Written by the indexing model from the issue text.
Description
cor_text() fails on any result that has a z column, which is every frequentist Kendall correlation:
library(correlation)
cor_text(cor_test(mtcars, "mpg", "wt", method = "kendall"))
#> Error in table$z : object of type 'closure' is not subsettable
cor_text(correlation(mtcars[1:3], method = "kendall")) fails the same way. The z branch in R/cor_text.R reads table$z where it means x$z.
Expected: the same text as for other methods, with the z statistic.
Related: with exact = TRUE, the z column holds Kendall's exact statistic T, not a z. The printed table already shows z = 36 here, and cor_text() would too once the error is fixed. It should probably be labeled T:
set.seed(2)
a <- rnorm(10)
b <- a + rnorm(10)
cor_test(data.frame(a, b), "a", "b", method = "kendall", exact = TRUE)$z
#> [1] 36
cor.test(a, b, method = "kendall", exact = TRUE)$statistic
#> T
#> 36
- Dominant language
- R
- Stars
- 455
- Forks
- 60
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 4
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from easystats/correlation
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
easystats/correlation#404 ·
-
[BUG] Two distinct bugs identified in the correlation package when using method = "biserial"May be free again @jmgirard claimed this 53 days ago, and no pull request is open. Openbug :bug:
Difficulty 4/5 3-5 days Newbie friendliness 68/100
easystats/correlation#372 · 1 comment · 1 assignee ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
easystats/correlation#356 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
easystats/correlation#355 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
easystats/correlation#354 · 2 comments ·
All issues in easystats/correlation
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
ThinkR-open/mordew#89 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
epiforecasts/EpiNow2#1694 · 2 reactions ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
mitchelloharawild/mixtime#111 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
easystats/performance#1038 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
conda-forge/xgboost-feedstock#313 ·