find_missing_starts {groupdata2} | R Documentation |
Find start positions that cannot be found in `data`
Description
Tells you which values and (optionally) skip-to-numbers
that are
recursively removed when using the "l_starts"
method with `remove_missing_starts`
set to TRUE
.
Usage
find_missing_starts(data, n, starts_col = NULL, return_skip_numbers = TRUE)
Arguments
data |
N.B. If |
n |
List of starting positions. Skip values by See |
starts_col |
Name of column with values to match
when |
return_skip_numbers |
Return |
Value
List of start values and skip-to-numbers
or a vector
with the start values.
Returns NULL
if no values were found.
N.B. If `data`
is a grouped data.frame
,
the function is applied group-wise and the output is a
list
of either vector
s or list
s.
The names are based on the group indices
(see dplyr::group_indices()
).
Author(s)
Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk
See Also
Other l_starts tools:
differs_from_previous()
,
find_starts()
,
group_factor()
,
group()
Examples
# Attach packages
library(groupdata2)
# Create a data frame
df <- data.frame(
"a" = c("a", "a", "b", "b", "c", "c"),
stringsAsFactors = FALSE
)
# Create list of starts
starts <- c("a", "e", "b", "d", "c")
# Find missing starts with skip_to numbers
find_missing_starts(df, starts, starts_col = "a")
# Find missing starts without skip_to numbers
find_missing_starts(df, starts,
starts_col = "a",
return_skip_numbers = FALSE
)