r-lib / cpp11

cpp11 helps you to interact with R objects using C++ code.
https://cpp11.r-lib.org/
Other
193 stars 46 forks source link

`as_integers` and `as_doubles` should understand logical inputs #297

Open vspinu opened 1 year ago

vspinu commented 1 year ago

Arguably logicals are also "integer like", but the main use case is the all-NA input vectors. When a user enters xyz(arg = NA) and arg is intended to be an integer the cpp level conversion with as_integers fails.

For this reason as_integers is still incomplete because we still need a custom wrapper around as_integer for logicals internally.

Would be really great if it could be done as part of #265 (cc @DavisVaughan)