vctrs icon indicating copy to clipboard operation
vctrs copied to clipboard

FAQ - Glossary

Open DavisVaughan opened this issue 3 years ago • 1 comments

From https://github.com/r-lib/vctrs/pull/1243#discussion_r484722269

Define naming scheme conventions:

  • "detect": A logical vector with the same size as x

  • "locate": An integer vector of locations that can be supplied as a subscript to vec_slice().

    • Generally the same as which(vec_detect_*())
  • "identify": An integer vector of identifiers the same size as x

This is somewhat dependent on having more functions that follow this naming scheme, as laid out in https://docs.google.com/spreadsheets/d/1lSrVbq6CQICpX1IQcamyPEhkcw232Um9TLWEjV00Kfw/edit#gid=0

Other terms:

  • "location" - An positive integer that can be used as a subscript in vec_slice()

  • "identifier" - A positive integer label that serves to separate groups in a vector. Unlike a location, an identifier is not used as a subscript.

  • "run" - A sequence of adjacent repeated values. A single vector can contain multiple runs.

DavisVaughan avatar Sep 08 '20 13:09 DavisVaughan

It would be nice to have this in a single place that we could link to. For example, in documentation:

#' `vec_identify_runs()` returns a vector of [identifiers](faq-glossary)

DavisVaughan avatar Sep 08 '20 13:09 DavisVaughan