View source: R/prep_check_meta_names.R
prep_check_meta_names | R Documentation |
This function verifies, if a data frame complies to metadata conventions and
provides a given richness of meta information as specified by level
.
prep_check_meta_names(meta_data = "item_level", level, character.only = FALSE)
meta_data |
data.frame the data frame that contains metadata attributes of study data |
level |
enum level of requirement (see also VARATT_REQUIRE_LEVELS).
set to |
character.only |
logical a logical indicating whether level can be assumed to be character strings. |
Note, that only the given level is checked despite, levels are somehow hierarchical.
a logical with:
invisible(TRUE). In case of problems with the metadata, a condition is
raised (stop()
).
## Not run:
prep_check_meta_names(data.frame(VAR_NAMES = 1, DATA_TYPE = 2,
MISSING_LIST = 3))
prep_check_meta_names(
data.frame(
VAR_NAMES = 1, DATA_TYPE = 2, MISSING_LIST = 3,
LABEL = "LABEL", VALUE_LABELS = "VALUE_LABELS",
JUMP_LIST = "JUMP_LIST", HARD_LIMITS = "HARD_LIMITS",
GROUP_VAR_OBSERVER = "GROUP_VAR_OBSERVER",
GROUP_VAR_DEVICE = "GROUP_VAR_DEVICE",
TIME_VAR = "TIME_VAR",
PART_VAR = "PART_VAR",
STUDY_SEGMENT = "STUDY_SEGMENT",
LOCATION_RANGE = "LOCATION_RANGE",
LOCATION_METRIC = "LOCATION_METRIC",
PROPORTION_RANGE = "PROPORTION_RANGE",
MISSING_LIST_TABLE = "MISSING_LIST_TABLE",
CO_VARS = "CO_VARS",
LONG_LABEL = "LONG_LABEL"
),
RECOMMENDED
)
prep_check_meta_names(
data.frame(
VAR_NAMES = 1, DATA_TYPE = 2, MISSING_LIST = 3,
LABEL = "LABEL", VALUE_LABELS = "VALUE_LABELS",
JUMP_LIST = "JUMP_LIST", HARD_LIMITS = "HARD_LIMITS",
GROUP_VAR_OBSERVER = "GROUP_VAR_OBSERVER",
GROUP_VAR_DEVICE = "GROUP_VAR_DEVICE",
TIME_VAR = "TIME_VAR",
PART_VAR = "PART_VAR",
STUDY_SEGMENT = "STUDY_SEGMENT",
LOCATION_RANGE = "LOCATION_RANGE",
LOCATION_METRIC = "LOCATION_METRIC",
PROPORTION_RANGE = "PROPORTION_RANGE",
DETECTION_LIMITS = "DETECTION_LIMITS", SOFT_LIMITS = "SOFT_LIMITS",
CONTRADICTIONS = "CONTRADICTIONS", DISTRIBUTION = "DISTRIBUTION",
DECIMALS = "DECIMALS", VARIABLE_ROLE = "VARIABLE_ROLE",
DATA_ENTRY_TYPE = "DATA_ENTRY_TYPE",
CO_VARS = "CO_VARS",
END_DIGIT_CHECK = "END_DIGIT_CHECK",
VARIABLE_ORDER = "VARIABLE_ORDER", LONG_LABEL =
"LONG_LABEL", recode = "recode",
MISSING_LIST_TABLE = "MISSING_LIST_TABLE"
),
OPTIONAL
)
# Next one will fail
try(
prep_check_meta_names(data.frame(VAR_NAMES = 1, DATA_TYPE = 2,
MISSING_LIST = 3), TECHNICAL)
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.