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

Section 3.2.4 Coercion order confusing #1796

Open
jxu opened this issue Jan 8, 2025 · 0 comments
Open

Section 3.2.4 Coercion order confusing #1796

jxu opened this issue Jan 8, 2025 · 0 comments

Comments

@jxu
Copy link

jxu commented Jan 8, 2025

The book says different types will be coerced in order: character -> double -> integer -> logical.

However the arrows don't make sense to me. I would put the arrows in reverse, like logical -> integer -> double -> character. That shows which can become which with implicit coercion. For example, c("a",1) becomes an atomic vector with elements "1" and "a", so in this case double -> character.
Or you could say in terms of "subsets" (although they are not really subsets), logical < integer < double < character.

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

1 participant