check_unique_keys {metatools} | R Documentation |
Check Uniqueness of Records by Key
Description
This function checks the uniqueness of records in the dataset by key using
get_keys
from the metacore package. If the key uniquely identifies each
record the function will print a message stating everything is as expected.
If records are not uniquely identified an error will explain the duplicates.
Usage
check_unique_keys(data, metacore, dataset_name = deprecated())
Arguments
Value
message if the key uniquely identifies each dataset record, and error otherwise
Examples
library(haven)
library(metacore)
library(magrittr)
load(metacore_example("pilot_ADaM.rda"))
spec <- metacore %>% select_dataset("ADSL")
data <- read_xpt(metatools_example("adsl.xpt"))
check_unique_keys(data, spec)
[Package metatools version 0.2.0 Index]