Learn R Programming

groupdata2 (version 1.0.0)

find_missing_starts: 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

Dataframe or Vector

n

List of starting positions.

Skip values by c(value, skip_to_number) where skip_to_number is the nth appearance of the value in the vector.

See group_factor for explanations and examples of using the l_starts method.

starts_col

Name of column with values to match when data is a dataframe. Pass 'index' to use row names. (Character)

return_skip_numbers

Return skip_to numbers along with values (Logical).

Value

List of start values and skip_to numbers or vector of the start values. Returns NULL if no values found.

See Also

Other l_starts tools: find_starts, group_factor, group

Examples

Run this code
# NOT RUN {
# Attach packages
library(groupdata2)

# Create a dataframe
df <- data.frame('a' = c('a','a','b',
                         'b','c','c'))

# 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)
# }

Run the code above in your browser using DataLab