Rdatatable / data.table

R's data.table package extends data.frame:
http://r-datatable.com
Mozilla Public License 2.0
3.58k stars 976 forks source link

export forder #3447

Open jangorecki opened 5 years ago

jangorecki commented 5 years ago

so it can be legally used outside of [.data.table

mattdowle commented 5 years ago

Discussion here: https://github.com/Rdatatable/data.table/pull/3817#discussion_r320659515

and move colnamesInt call down to C: https://github.com/Rdatatable/data.table/pull/3817/files#r320951619

akersting commented 4 years ago

I would also like to have forder and forderv exported. These are very useful functions also for other packages.

mattfidler commented 4 years ago

I think you upvote on the top to show your interest

jangorecki commented 4 years ago

Before exporting, we should resolve #4467, also lazy argument may need some rework because its current API is more internal-like.

MichaelChirico commented 5 days ago

I'm curious the advantage of exporting forder(), doesn't base R's order() already do basically the same thing?

mattfidler commented 5 days ago

Hi @MichaelChirico it is parallelized. R's forder is not.

MichaelChirico commented 5 days ago

Thanks. What about DT[order(...), which=TRUE]?

mattfidler commented 5 days ago

Thanks. What about DT[order(...), which=TRUE]?

For me, this requires access to the dsl inside of data.table, which is a bit difficult when I call it from C/C++

mattfidler commented 5 days ago

Technically from within C, I can load the data.table namespace and call the function directly, though it violates CRAN policies. I suppose it does not if I have agreement with the data.table maintainers that this is legal.

MichaelChirico commented 5 days ago

4015 seems better suited to your use case

mattfidler commented 5 days ago

That is why I opened the issue 😄; This would be a work-around in the mean time.

mattfidler commented 5 days ago

To really do this well you would have to have a non-linking API so that there is no binary dependencies. (ie. don't simply register the C callable).

I have done something similar with rxode2 recently. It took me some time to figure out what needed to be done and I am planning to post a blog post about it.

MichaelChirico commented 5 days ago

Thanks! Indeed it makes me lean to keeping forder() private on the R side. Then we could play around a little more with the API without exposing anything to the user. Context: #5167.