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

feature request: parse LogicalVector C++ default arguments into R equivalents #1216

Closed
klin333 opened this issue May 9, 2022 · 2 comments
Closed

Comments

@klin333
Copy link

klin333 commented May 9, 2022

Hi,

According to https://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-attributes.pdf, not all C++ default argument values can be parsed into their R equivalents, but Rcpp can handle CharacterVector, IntegerVector, and NumericVector instantiated using the ::create static member function.

This is a feature request to also allow LogicalVector::create. The current work around I use is to use cpp_func(arg=IntegerVector::create(1, 0)) instead of the more desirable =LogicalVector::create(true, false).

@eddelbuettel
Copy link
Member

Hm, not unreasonable but I have somewhere in the back of my head a notion that the fact that R has three values for boolean (namely true, false and na) whereas standard bool only has two as a stumbling block.

I don't think anybody has poked in that corner of the code in a while. Maybe it is doable with a simple templated specialisation, or maybe it is more involved all the way to near impossible. Do you want to take a poke?

@github-actions
Copy link

This issue is stale (365 days without activity) and will be closed in 31 days unless new activity is seen. Please feel free to re-open it is still a concern, possibly with additional data.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants