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

is_integer() incorrectly reports TRUE for factors #781

Closed
holgerbrandl opened this issue Jun 6, 2019 · 1 comment
Closed

is_integer() incorrectly reports TRUE for factors #781

holgerbrandl opened this issue Jun 6, 2019 · 1 comment

Comments

@holgerbrandl
Copy link

Example

is_integer(factor(1:3))

which gives TRUE. In contrast is.integer(factor(1:3)) reports FALSE.

Although a factor can be converted to in, it intuitively is not an integer vector. E.g. factor(1:3) + 1 results in an error: In Ops.factor(factor(1:3), 1) : ‘+’ not meaningful for factors

@lionel-
Copy link
Member

lionel- commented Jun 11, 2019

This is expected, rlang is about base types, not conceptual types. The vctrs and funs packages might have conceptual predicates.

@lionel- lionel- closed this as completed Jun 11, 2019
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