Get names of columns that form a (unique) key associated with an object
Source:R/key_colnames.R
      key_colnames.RdThis is entirely based on metadata and arguments passed; there are no explicit checks that the key actually is unique in any associated data structures.
Usage
key_colnames(x, ..., exclude = character())
# S3 method for class 'data.frame'
key_colnames(x, ..., geo_keys, other_keys, time_keys, exclude = character())
# S3 method for class 'epi_df'
key_colnames(
  x,
  ...,
  geo_keys = "geo_value",
  other_keys = attr(x, "metadata")$other_keys,
  time_keys = "time_value",
  exclude = character()
)
# S3 method for class 'tbl_ts'
key_colnames(x, ..., exclude = character())
# S3 method for class 'epi_archive'
key_colnames(x, ..., exclude = character())Arguments
- x
- an object, often a data frame or something similar. - {epiprocess}includes implementations for- epi_dfs,- epi_archives,- tsibble::tsibbles, and other data frames (including- tibble::tibbles); other packages, like- {epipredict}, can add more.
- ...
- additional arguments passed on to methods 
- exclude
- an optional character vector of key column names to exclude from the result 
- geo_keys, other_keys, time_keys
- character vectors, sometimes optional; which variables (if any) should be considered as part of a unique key/identifier for data in - x, dealing respectively with the associated geographical region, demographic/strain/other information needed in addition to the geographical region to identify individual time series in- x, and time interval during which associated events occurred.- Mandatory if - xis a regular- data.frameor- tibble. Optional if- xis an- epi_df; the defaults are- "geo_value", the- epi_df's- other_keysmetadata, and- "time_value", respectively; if you provide these manually, they must match the defaults. (This behavior is to enable consistent and sane results when you can't guarantee whether- xis an- epi_dfor just a- tibble/- data.frame. You don't need to use it if you know that- xis definitely an- epi_df.) Not accepted when- xis a- tsibbleor an- epi_archive.