Comments (3)
The conversion of the NA
to FALSE
happens with %in%
, and is unrelated to dplyr code
x <- c(NA, 1,2,3)
x %in% 2
#> [1] FALSE FALSE TRUE FALSE
So there is nothing for dplyr to do here. Converting NA
to FALSE
is just a known side effect of how %in%
and match()
work.
from dplyr.
If you really want NA
s to pass through, you can use vctrs::vec_in()
with na_equal = FALSE
vctrs::vec_in(c(NA, 1, 2, 3), 2, na_equal = FALSE)
#> [1] NA FALSE TRUE FALSE
But for the most part that is considered "advanced usage"
from dplyr.
Helpful, I did not know that. Thanks.
from dplyr.
Related Issues (20)
- group_split(): add a '.groups_to_names=T' type argument HOT 2
- `group_split()` not shown on the reference page
- Modify how arrange sorts strings HOT 3
- Should `desc()` use `vec_rank()` internally on character vectors?
- Problem Group_by
- `dplyr_reconstruct` can create data.table with corrupted secondary index HOT 1
- Split `join_cols()`
- Error in the function 'across()' HOT 3
- Documentation error for count HOT 4
- Add a Ranking Function to Compute Tail Means HOT 1
- across(), but over two sets of vector
- filter may crash RStudio Session when combining rbind and rowwise HOT 3
- Look at dplyrover HOT 1
- `if_any` on zero-column selection yields `TRUE` HOT 2
- Typo in cumulative function docs
- `bind_rows` does not capture `tapply` output names with `.id` parameter HOT 1
- A subtle scoping flaw in pull()
- Feature Request: add `.groups = "drop"` option to `mutate` HOT 3
- Feature request: global option for summarise .groups setting HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dplyr.