Utility functions for keyed objects which are implemented with class keyed_df. Keyed object should be a data frame which inherits from keyed_df and contains a data frame of keys in attribute 'keys'.

is_keyed_df(.tbl)

is.keyed_df(.tbl)

# S3 method for keyed_df
print(x, ...)

# S3 method for keyed_df
[(x, i, j, ...)

Arguments

.tbl

Object to check.

x

Object to print or extract elements.

...

Further arguments passed to or from other methods.

i, j

Arguments for [.

Examples

is_keyed_df(mtcars)
#> [1] FALSE

mtcars %>% key_by(vs) %>% is_keyed_df
#> [1] TRUE

# Not valid keyed_df
df <- mtcars
class(df) <- c("keyed_df", "data.frame")
is_keyed_df(df)
#> [1] FALSE