forked from pharmaverse/admiral
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassert_unit.Rd
37 lines (34 loc) · 1.02 KB
/
assert_unit.Rd
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/assertions.R
\name{assert_unit}
\alias{assert_unit}
\title{Asserts That a Parameter is Provided in the Expected Unit}
\usage{
assert_unit(dataset, param, required_unit, get_unit_expr)
}
\arguments{
\item{dataset}{A \code{data.frame}}
\item{param}{Parameter code of the parameter to check}
\item{required_unit}{Expected unit}
\item{get_unit_expr}{Expression used to provide the unit of \code{param}}
}
\value{
The function throws an error if the unit variable differs from the
unit for any observation of the parameter in the input dataset. Otherwise, the
dataset is returned invisibly.
}
\description{
Checks if a parameter (\code{PARAMCD}) in a dataset is provided in the expected
unit.
}
\examples{
data(admiral_advs)
assert_unit(admiral_advs, param = "WEIGHT", required_unit = "kg", get_unit_expr = VSSTRESU)
\dontrun{
assert_unit(admiral_advs, param = "WEIGHT", required_unit = "g", get_unit_expr = VSSTRESU)
}
}
\author{
Stefan Bundfuss
}
\keyword{assertion}