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 Polars Categorical/Enum to R factor conversion via Rust #1146

Open
eitsupi opened this issue Jun 22, 2024 · 2 comments
Open

Make Polars Categorical/Enum to R factor conversion via Rust #1146

eitsupi opened this issue Jun 22, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@eitsupi
Copy link
Collaborator

eitsupi commented Jun 22, 2024

Currently the conversion to the factor type is performed by calling the factor() function in R.

Enum(_, _) => s
.categorical()
.map(|ca| extendr_api::call!("factor", ca.iter_str().collect_robj()).unwrap()),
Categorical(_, _) => s
.categorical()
.map(|ca| extendr_api::call!("factor", ca.iter_str().collect_robj()).unwrap()),

but I think it would be possible to perform the conversion on Rust by porting the process from the arrow package.
https://github.com/apache/arrow/blob/26724ab787d12854f109d01571638b099f2bc8a5/r/src/array_to_vector.cpp#L563-L717

@eitsupi eitsupi added the enhancement New feature or request label Jun 22, 2024
@etiennebacher etiennebacher changed the title Polars Categolical/Enum -> R factor conversion via Rust Make Categorical/Enum to R factor conversion via Rust Jun 22, 2024
@eitsupi eitsupi changed the title Make Categorical/Enum to R factor conversion via Rust Make Polars Categorical/Enum to R factor conversion via Rust Jul 11, 2024
@andyquinterom
Copy link
Contributor

Is there any progress on this? I might be able to take the responsability

@eitsupi
Copy link
Collaborator Author

eitsupi commented Nov 12, 2024

Thanks. Probably no one is working on this at this time.

BTW, we are shifting our focus to the next branch (under development in https://github.com/eitsupi/neo-r-polars) on adding new features, so it might be better to have them work on that.
(Currently the main branch is stuck on updating Rust Polars #1271)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants