FreesearchR/man/grepl_fix.Rd

25 lines
630 B
Text
Raw Normal View History

2025-03-11 13:42:57 +01:00
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/wide2long.R
\name{grepl_fix}
\alias{grepl_fix}
\title{Matches pattern to vector based on match type}
\usage{
grepl_fix(data, pattern, type = c("prefix", "infix", "suffix"))
}
\arguments{
\item{data}{vector}
\item{pattern}{pattern(s) to match. Character vector of length 1 or more.}
\item{type}{type of match. can be one of "prefix","infix" or "suffix".}
}
\value{
logical vector
}
\description{
Matches pattern to vector based on match type
}
\examples{
c("id", "age", "weight_0", "weight_1") |> grepl_fix(pattern = c("_0", "_1"), type = "suffix")
}