REDCapCAST/man/case_match_regex_list.Rd

32 lines
826 B
R

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/doc2dd.R
\name{case_match_regex_list}
\alias{case_match_regex_list}
\title{List-base regex case_when}
\usage{
case_match_regex_list(data, match.list, .default = NA)
}
\arguments{
\item{data}{vector}
\item{match.list}{list of case matches}
\item{.default}{Default value for non-matches. Default is NA.}
}
\value{
vector
}
\description{
Mimics case_when for list of regex patterns and values. Used for date/time
validation generation from name vector. Like case_when, the matches are in
order of priority.
Primarily used in REDCapCAST to do data type coding from systematic variable
naming.
}
\examples{
case_match_regex_list(
c("test_date", "test_time", "test_tida", "test_tid"),
list(date_dmy = "_dat[eo]$", time_hh_mm_ss = "_ti[md]e?$")
)
}