-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathset_variable_labels.Rd
More file actions
49 lines (45 loc) · 1.67 KB
/
set_variable_labels.Rd
File metadata and controls
49 lines (45 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/labels.R
\name{set_variable_labels}
\alias{set_variable_labels}
\title{Apply labels to a data frame using a metacore object}
\usage{
set_variable_labels(
data,
metacore,
dataset_name = deprecated(),
verbose = c("message", "warn", "silent")
)
}
\arguments{
\item{data}{A dataframe or tibble upon which labels will be applied}
\item{metacore}{metacore object that contains the specifications for the
dataset of interest.}
\item{dataset_name}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Optional string to
specify the dataset that is being built. This is only needed if the metacore
object provided hasn't already been subsetted.\cr
Note: Deprecated in version 0.2.0. The \code{dataset_name} argument will be removed
in a future release. Please use \code{metacore::select_dataset} to subset the
\code{metacore} object to obtain metadata for a single dataset.}
\item{verbose}{Character string controlling message verbosity. One of:
\describe{
\item{\code{"message"}}{Show both warnings and messages (default)}
\item{\code{"warn"}}{Show warnings but suppress messages}
\item{\code{"silent"}}{Suppress all warnings and messages}
}}
}
\value{
Dataframe with labels applied
}
\description{
This function leverages metadata available in a metacore object to apply
labels to a data frame.
}
\examples{
mc <- metacore::spec_to_metacore(
metacore::metacore_example("p21_mock.xlsx"),
quiet = TRUE
)
dm <- haven::read_xpt(metatools_example("dm.xpt"))
set_variable_labels(dm, mc, dataset_name = "DM")
}