If the input (grouping variable) in ConoverTest() is accidentally a character and not a factor variable, a non-meaningful (user-unfriendly) error message is issued.
(This is just an example for reproduction, but I got a similar result with real data):
DescTools::ConoverTest(
weight ~ as.character(feed),
data = chickwts,
method = "holm"
)
#> Error in ConoverTest.default(method = method, c(179, 160, 136, 227, 217, : all group levels must be finite
I think the behavior of function must be changed in either of 2 ways:
1) character could be automatically converted into a factor in the function (preferred);
2) or a meaningful error message that a grouping variable is not a factor should be issued.
Thanks for bringing this up, Vilmantas. I have fixed it for (as far as I can see) all post hoc tests in [0.99.45.2].
Please check and close the issue, if ok.
Best, Andri
If the input (grouping variable) in
ConoverTest()
is accidentally a character and not a factor variable, a non-meaningful (user-unfriendly) error message is issued.(This is just an example for reproduction, but I got a similar result with real data):
Created on 2022-05-22 by the reprex package (v2.0.1)
I think the behavior of function must be changed in either of 2 ways:
1) character could be automatically converted into a factor in the function (preferred); 2) or a meaningful error message that a grouping variable is not a factor should be issued.