major overhaul with new functions. docs are lacking

This commit is contained in:
Andreas Gammelgaard Damsbo 2024-05-02 13:31:21 +02:00
commit 04f5bec85c
No known key found for this signature in database
28 changed files with 874 additions and 81 deletions

View file

@ -0,0 +1,31 @@
% 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?$")
)
}