Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make 'CsubsetDT' callable from C in other packages #3751

Closed
lsilvest opened this issue Aug 8, 2019 · 3 comments · Fixed by #4084
Closed

make 'CsubsetDT' callable from C in other packages #3751

lsilvest opened this issue Aug 8, 2019 · 3 comments · Fixed by #4084
Milestone

Comments

@lsilvest
Copy link
Contributor

lsilvest commented Aug 8, 2019

I'm writing a package (lsilvest/dtts.utils) that has functions that subset data.table.

These functions provide time series functionality to a data.table that has as first column a nanotime type (eddelbuettel/nanotime) and will allow pretty cool subsettings on intervals, alignment to a grid, etc.

For this I need efficient subsetting at C level and I wouldn't need to duplicate C code if CsubsetDT were exported. It's a one liner to export it (R_RegisterCCallable("data.table", "CsubsetDT", (DL_FUNC) &subsetDT);) and I have committed it in a fork that could be pulled (7c84115).

Any chance this would be possible?

@jangorecki
Copy link
Member

jangorecki commented Aug 8, 2019

Recent idea in #3736 seems very related, but it is still R interface.
If you are planning to call it from C mainly then it make sense to go even deeper, as you propose. Eventually not just this single function but we can try to formulate C API, that would be also a step towards #852.

@lsilvest
Copy link
Contributor Author

lsilvest commented Aug 8, 2019

Indeed my use cases for calling CsubsetDT are within loops at C level that construct a new data.table, but I could construct an index at C level and then the solution in #3736 would be satisfactory, even if not always optimal and a bit less flexible.

@jangorecki jangorecki added this to the 1.13.0 milestone Aug 23, 2019
@jangorecki
Copy link
Member

jangorecki commented Nov 30, 2019

@lsilvest could you fill PR to address your request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants