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 index that makes the input sorted, as in R's order(). However 
running the following code on
R version 4.0.5 (2021-03-31) Platform: x86_64-pc-linux-gnu (64-bit)
does not give me that. It just gives me the original input.

Rlib = file.path(Sys.getenv("R_HOME"), "lib", paste0("libR", 
.Platform$dynlib.ext))
dyn.load(Rlib)
n = 4L
ix = n:1
i = integer(n)
cc = .C("R_qsort_int_I", ix, i, 1L, n)
cc[[2]]

I expect 4 3 2 1, but I get 0 0 0 0. Is this a bug or have I misunderstood 
something?

Best,
Vangelis

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to