powered by
Functions for getting information about keys.
keys(.tbl)raw_keys(.tbl)has_keys(.tbl)
raw_keys(.tbl)
has_keys(.tbl)
keys() always returns a tibble of keys. In case of no keys it returns a tibble with number of rows as in .tbl and zero columns. raw_keys() is just a wrapper for attr(.tbl, "keys"). To know whether .tbl has keys use has_keys().
keys()
.tbl
raw_keys()
attr(.tbl, "keys")
has_keys()
Reference data frame.
Set keys, Manipulate keys
keys(mtcars) raw_keys(mtcars) has_keys(mtcars) df <- key_by(mtcars, vs, am) keys(df) has_keys(df)
Run the code above in your browser using DataLab