patternapply

Iteratively try patterns against a character vector.
git clone https://git.eamoncaddigan.net/patternapply.git
Log | Files | Refs | README | LICENSE

commit 624273d5d6cc5dd748be5a09c8a8c20796a20d5d
parent 1878fc2914f18f6afb7807ccf1e1025837349f54
Author: eamoncaddigan <eamon.caddigan@gmail.com>
Date:   Mon, 29 Feb 2016 13:58:29 -0500

Fixed the package documentation thanks to advice from @sckott!

Diffstat:
MR/patternapply.R | 4+---
Aman/patternapply-package.Rd | 14++++++++++++++
Mman/patternapply.Rd | 26++++++++++++++++++--------
Dman/patternapply_fun.Rd | 25-------------------------
4 files changed, 33 insertions(+), 36 deletions(-)

diff --git a/R/patternapply.R b/R/patternapply.R @@ -7,7 +7,7 @@ #' provided to assist with this. #' #' @docType package -#' @name patternapply +#' @name patternapply-package NULL @@ -23,8 +23,6 @@ NULL #' @return A list of replacement vectors with class "replacement_list". #' #' @export -#' -#' @rdname patternapply_fun patternapply <- function(X, patterns, replacements = as.list(paste(seq_along(patterns)))) { # Check the inputs diff --git a/man/patternapply-package.Rd b/man/patternapply-package.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/patternapply.R +\docType{package} +\name{patternapply-package} +\alias{patternapply-package} +\title{patternappy: A package for attempting to apply patterns to a vector.} +\description{ +This package contains the function \code{patternapply()}, which iteratively +tries to match a list of regular expressions to a vector and returns the +associated replacement vector. This is useful for turning a column of text +data with different formats into a matrix or data frame. S3 generics are also +provided to assist with this. +} + diff --git a/man/patternapply.Rd b/man/patternapply.Rd @@ -1,15 +1,25 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/patternapply.R -\docType{package} \name{patternapply} \alias{patternapply} -\alias{patternapply-package} -\title{patternappy: A package for attempting to apply patterns to a vector.} +\title{Iteratively try patterns against a character vector.} +\usage{ +patternapply(X, patterns, replacements = as.list(paste(seq_along(patterns)))) +} +\arguments{ +\item{X}{A character vector where matches are sought.} + +\item{patterns}{A vector of regular expression patterns.} + +\item{replacements}{A list of replacement information, which must match the +length of \code{patterns}. Each element must be a character vector. This +can include backreferences "\1" to "\9" to parenthesized subexpressions of +the corresponding pattern.} +} +\value{ +A list of replacement vectors with class "replacement_list". +} \description{ -This package contains the function \code{patternapply()}, which iteratively -tries to match a list of regular expressions to a vector and returns the -associated replacement vector. This is useful for turning a column of text -data with different formats into a matrix or data frame. S3 generics are also -provided to assist with this. +Iteratively try patterns against a character vector. } diff --git a/man/patternapply_fun.Rd b/man/patternapply_fun.Rd @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/patternapply.R -\name{patternapply} -\alias{patternapply} -\title{Iteratively try patterns against a character vector.} -\usage{ -patternapply(X, patterns, replacements = as.list(paste(seq_along(patterns)))) -} -\arguments{ -\item{X}{A character vector where matches are sought.} - -\item{patterns}{A vector of regular expression patterns.} - -\item{replacements}{A list of replacement information, which must match the -length of \code{patterns}. Each element must be a character vector. This -can include backreferences "\1" to "\9" to parenthesized subexpressions of -the corresponding pattern.} -} -\value{ -A list of replacement vectors with class "replacement_list". -} -\description{ -Iteratively try patterns against a character vector. -} -