find_acno_incomplete: Find gaps in AC No. sequence in Indian states

View source: R/sequence_checks.R

find_acno_incompleteR Documentation

Find gaps in AC No. sequence in Indian states

Description

wrapper around find_seq_incomplete with additional checks for use with (Indian) Assembly Constituency data

Identifies **gaps** only, if the sequence is broken because of a duplication, use duplicheck.

Usage

find_acno_incomplete(
  df,
  checkCols = NULL,
  comparison = `==`,
  step = NULL,
  verbose = FALSE
)

Arguments

df

A dataframe. The default assumes one column for state names and one column for AC numbers. The state column name is automatically detected and the AC number column name assumed to be either AC_NO or ac_no.

checkCols

To override defaults, provide a character vector with exactly two strings. The first names the grouping variable, and the second, the accompanying numeric sequence variable.

comparison

A relational operator for the check, with back-ticks.

step

Step to be used in comparison. Defaults to the difference between the first and second elements of the vector.

verbose

Should messages be reported?

Value

If any gaps found, the function returns a data frame with two rows before and one after the gap in the sequence, extracted by group. If no gaps found, NULL invisibly.


AltfunsMA/cptools documentation built on Aug. 7, 2022, 5:44 p.m.