Description Usage Arguments Details Value See Also Examples
Based on a reference dataset x
, this function helps you
identify stems that remain to be recensused in a dataset y
. This
function does the same work as dplyr::anti_join()
. The only difference is
that the signature of pick_recensus()
is a little simpler (irrelevant
arguments hidden via ...
) to focus your attention on the arguments that are
most useful in helping you identify stems to recensus. This function also
exists to help you discover the *join()
functions of dplyr, which will
help you solve more general problems.
1 | pick_recensus(x, y, by = NULL, ...)
|
x, y |
Dataframes to join:
|
by |
a character vector of variables to join by. If To join by different variables on x and y use a named vector.
For example, |
... |
Other parameters passed onto dplyr::anti_join. |
This function preserves dplyr's style and thus non-standard evaluation. If you want to use it inside your own functions, you should learn about tidy eval (implemented via the rlang package). A good place to start is at dplyr's website.
Returns all rows from x
where there are not matching values in
y
, keeping just columns from x
.
Other general functions to pick or drop rows of a dataframe: in_top
,
pick_top
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | x <- tibble::tribble(
~unique_stem, ~quadrat,
"01_1", "001",
"02_1", "001",
"02_2", "001",
"04_1", "002",
"04_2", "002",
"05_1", "002"
)
y <- tibble::tribble(
~unique_stem,
"01_1",
"02_2",
"04_2"
)
pick_recensus(x, y)
# Same
pick_recensus(x, y, by = "unique_stem")
y2 <- dplyr::tribble(
~unq_stem,
"01_1",
"02_2",
"04_2"
)
pick_recensus(x, y2, by = c("unique_stem" = "unq_stem"))
# For this and more general problems you can use `dplyr::*_join()` functions
dplyr::anti_join(x, y2, by = c("unique_stem" = "unq_stem"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.