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
> .C("mysort2i",4:1,integer(4),4L)
[[1]]
[1] 1 2 3 4
[[2]]
R_ext/Utils.h:void R_qsort_int_I(int *iv, int *II, int i, int j);
The last 2 arguments are int, not int*. .C() passes pointers to vectors so
you cannot call this function directly from .C().
-Bill
On Thu, Apr 15, 2021 at 3:15 PM Evangelos Evangelou via R-help <
r-help@r-project.org> wrote:
>
Hi all.
Reading the documentation of these two functions
https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Utility-functions
"The ..._I() versions also return the sort.index() vector in I."
I can't find anything in the documentation about sort.index(), but I'm guessing
that I is the
3 matches
Mail list logo