Skip to content
Prev 387825 / 398502 Next

Bug? Index output of C functions R_qsort_I and R_qsort_int_I is not modified

Thanks for your input Bill.

I also realised that the second argument must be initialised to 1:n, which is not mentioned in the documentation. So, if I define
void mysort2i (int *x, int *i, int *n)
{
  R_qsort_int_I(x,i,1,*n);
}

Then
[[1]]
[1] 1 2 3 4

[[2]]
[1] 0 0 0 0

[[3]]
[1] 4

but
[[1]]
[1] 1 2 3 4

[[2]]
[1] 4 3 2 1

[[3]]
[1] 4
Message-ID: <CWXP265MB215156CB19B868F2D7DC0E86CD4C9@CWXP265MB2151.GBRP265.PROD.OUTLOOK.COM>
In-Reply-To: <CAHqSRuT2nZrHZ_FXvXa4a4b9j6noHuP-6Ak28B6ACaui_Hesow@mail.gmail.com>