Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fail to compute report for Kruskal test in some cases #454

Assignees
copilot-swe-agent
Labels
bug 🐛Something isn't working
@AndeolEvain

Description

@AndeolEvain

Description
When a nominal vector has a lot of levels, and we compute a Kruskal test between this vector and a numerical one, the kruskal.test() function works fine, and returns fast. But the call to report() on the resulting object takes a long time, triggers a lot of warnings, and eventually fails with an error.

To Reproduce
The following code should reproduce the issue from scratch:

library("report")n <- 200df <- data.frame(a = as.factor(1:n), b = sample(30, n, replace = TRUE))test <- kruskal.test(df$b, df$a)report(test)

The last line of this code takes a lot of time to process, while the call to kruskal.test is instantaneous. The number of warnings seems to grow at least quadratically with n.
It eventually ends with:

[1] "All values of t are equal to  1 \n Cannot calculate confidence intervals"Erreur dans data.frame(CI = ci, CI_low = bCI[1], CI_high = bCI[2]) :   les arguments impliquent des nombres de lignes différents : 1, 0De plus : Il y a eu 50 avis ou plus (utilisez warnings() pour voir les 50 premiers)

Expected behaviour
I don't think report should have a bigger time complexity than the call to Kruskal.test, since it's only supposed to describe the results of that test, not perform additional computations. For the same reasons, the conditions of applications should be similar. When given a valid htest object, report should be able to describe it, even if that description has to involves some warnings and NAs.

Observed on version 0.5.8

Metadata

Metadata

Assignees

Labels

bug 🐛Something isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp