Re: [Rd] Faster sorting algorithm...

2021-03-15 Thread Abby Spurdle
In principle, I agree that faster ranking/sorting algorithms are important, and should be a priority. But I can't help but feel that the paper focuses on textbook-oriented problems. Given that in real world problems, there's almost always some form of prior knowledge: Wouldn't it be better, from a

Re: [Rd] Potential improvements of ave?

2021-03-15 Thread Gabriel Becker
Abby, Vectors do have an internal mechanism for knowing that they are sorted via ALTREP (it was one of 2 core motivating features for 'smart vectors' the other being knowledge about presence of NAs). Currently I don't think we expose it at the R level, though it is part of the official C API. I d

Re: [Rd] [EXTERNAL] Re: inheritance and attach

2021-03-15 Thread Therneau, Terry M., Ph.D. via R-devel
Thanks Simon.  I missed that.   It is a sensible change. I had trouble because I had just changed computing environments this weekend (a forced change due to an institutional directive), and this caught me right after that so I spent some time chasing my tail.  Murphy's law... Terry T. On 3/

Re: [Rd] inheritance and attach

2021-03-15 Thread Simon Urbanek
Terry, NEWS: CHANGES IN R 4.0.0 NEW FEATURES \item S3 method lookup now by default skips the elements of the search path between the global and base environments. If you use attach(), S3 methods are hence no longer dispatched to (because it is between global and base) unless you regi

Re: [Rd] Potential improvements of ave?

2021-03-15 Thread SOEIRO Thomas
Hi Abby, Thank you for your positive feedback. I agree for your general comment about sorting. For ave specifically, ordering may not help because the output must maintain the order of the input (as ave returns only x and not the entiere data.frame). Thanks, Thomas ___

[Rd] inheritance and attach

2021-03-15 Thread Therneau, Terry M., Ph.D. via R-devel
This change in R-devel just bit me.   Under the newest release, if I attach() another .RData directory, the methods are not detected. Was it intentional?   Running in Linux.   Here is a script of an example that works fine under 3.6.2. but fails in R-devel. tmt% mkdir temp1 tmt% cd temp1 tmt%

Re: [Rd] Faster sorting algorithm...

2021-03-15 Thread Morgan Morgan
Default method for sort is not radix(especially for character vector). You might want to read the documentation of sort. For your second question, I invite you to look at the code of fsort. It is implemented only for positive finite double, and default to data.table:::forder ... when the types are

Re: [Rd] Faster sorting algorithm...

2021-03-15 Thread Avraham Adler
Isn’t the default method now “radix” which is the data.table sort, and isn’t that already parallel using openmp where available? Avi On Mon, Mar 15, 2021 at 12:26 PM Morgan Morgan wrote: > Hi, > I am not sure if this is the right mailing list, so apologies in advance if > it is not. > > I found

[Rd] Faster sorting algorithm...

2021-03-15 Thread Morgan Morgan
Hi, I am not sure if this is the right mailing list, so apologies in advance if it is not. I found the following link/presentation: https://www.r-project.org/dsc/2016/slides/ParallelSort.pdf The implementation of fsort is interesting but incomplete (not sure why?) and can be improved or made fast

Re: [Rd] Potential improvements of ave?

2021-03-15 Thread Abby Spurdle
Hi Thomas, These are some great suggestions. But I can't help but feel there's a much bigger problem here. Intuitively, the ave function could (or should) sort the data. Then the indexing step becomes almost trivial, in terms of both time and space complexity. And the ave function is not the only

Re: [Rd] R extension memory leak detection question

2021-03-15 Thread Tomas Kalibera
On 3/12/21 7:43 PM, xiaoyan yu wrote: I am writing C++ program based on R extensions and also try to test the program with google address sanitizer. I thought if I don't protect the variable from the allocation API such as Rf_allocVector, there will be a memory leak. However, the address sanitiz