feat: new string split function to allow splitting string into rows or columns. select from allowed delimiters.

This commit is contained in:
Andreas Gammelgaard Damsbo 2025-10-30 14:49:38 +01:00
commit 48f4d99429
No known key found for this signature in database
5 changed files with 404 additions and 4 deletions

22
man/detect_delimiter.Rd Normal file
View file

@ -0,0 +1,22 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/separate_string.R
\name{detect_delimiter}
\alias{detect_delimiter}
\title{Detect delimiters in string based on allowed delimiters}
\usage{
detect_delimiter(data, delimiters = c("_", "-", ";", "\\n", ","))
}
\arguments{
\item{delimiters}{allowed delimiters}
\item{text}{character vector}
}
\value{
character vector
}
\description{
Accepts any repeat of delimiters and includes surrounding whitespace
}
\examples{
sapply(c("Walk - run", "Sel__Re", "what;now"), detect_delimiter)
}

23
man/separate_string.Rd Normal file
View file

@ -0,0 +1,23 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/separate_string.R
\name{separate_string}
\alias{separate_string}
\title{Separate string wide or long}
\usage{
separate_string(data, col, delim, direction = c("wide", "long"))
}
\arguments{
\item{data}{data}
\item{col}{column}
\item{delim}{delimiter}
\item{direction}{target direction}
}
\value{
data.frame
}
\description{
Separate string wide or long
}