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

Support mapping logical values into the closest supported type #13

Closed
scw opened this issue Aug 2, 2017 · 0 comments
Closed

Support mapping logical values into the closest supported type #13

scw opened this issue Aug 2, 2017 · 0 comments

Comments

@scw
Copy link
Member

scw commented Aug 2, 2017

As reported by Andrew Gilbert, when writing out logical (boolean) values with arc.write(), NA values will instead be written out as -1, which as.logical() will evaluate as TRUE. Logicals in R have the following possible values:

Name Possible values
True TRUE, T, 1
False FALSE, F, 0
Not Available NA

While NA and NULL are actually different concepts, for the purposes of the bridge, they can be treated as equivalent for data exchange. It'd make sense to retain these either as:

  • A string, with the values TRUE, FALSE and NULL. This is the best choice from an R perspective, as its tools can directly interpret these as logical values.
  • A short, with the values 1, 0, and NULL. R won't automatically recognize these are logical values, but they can be cast to the correct type with as.logical.
dpavlushko added a commit that referenced this issue Aug 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants