I just wasted a whole day searching for a solution for my problem.
So briefly, I have 2 datasets with 2 samples each from a wilcox_test. Now, I wanted to test for effect size. For the first dataset I receive an effect size "r", for the other I receive a error message:
library(rcompanion)
wilcoxonPairedR(x = sport_1_4$value, g = sport_1_4$variable)
Fehler in wilcoxonZ(x = x[as.numeric(g) == 1], y = x[as.numeric(g) == 2], :
'x' and 'y' must have the same length
I did exactly the same, but it won't work.
EDIT: I have the same amount of obs for both variables.
> table(sport_1_4$variable)
sport_t1 sport_t2 sport_t3 sport_t4
38 0 0 38
dataset1 - testing t1 and t2
> head(sport_1_2)
ID variable value
1 1 sport_t1 2
2 2 sport_t1 4
3 3 sport_t1 4
4 4 sport_t1 2
5 5 sport_t1 3
6 6 sport_t1 2
dataset2 - testing t1 and t4
> head(sport_1_4)
ID variable value
1 1 sport_t1 2
2 2 sport_t1 4
3 3 sport_t1 4
4 4 sport_t1 2
5 5 sport_t1 3
6 6 sport_t1 2
Ok, I solved it by copying the dataset into a new excel sheet, and importing it into Rstudio. Now it works... I didn't change anything at all. Weird.