View source: R/is_valid_primary_key.R
| is_valid_primary_key | R Documentation |
data.frame?I sometimes see tables with obscure structure so I try to guess their primary keys.
is_valid_primary_key(data, key, verbose = TRUE)
data |
The |
key |
Character vector containing a subset of the columns names of
|
verbose |
Be verbose? |
TRUE, if key is a valid primary key,
FALSE otherwise.
Other bits and pieces:
golden_ratio(),
is_difftime_less(),
pause(),
r_cmd_install(),
rownames2col(),
str2num(),
string2words(),
strip_off_attributes(),
tapply(),
throw()
is_valid_primary_key(mtcars, "qsec")
is_valid_primary_key(mtcars, "carb")
is_valid_primary_key(mtcars, c("qsec", "gear"))
is_valid_primary_key(mtcars, c("qsec", "carb"))
cars <- mtcars
cars$id <- seq_len(nrow(cars))
is_valid_primary_key(cars, "id")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.