patternapply

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

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

Didn't even realize that roxygen2 took over the NAMESPACE.

Diffstat:
MNAMESPACE | 3+++
MR/generics.R | 4++++
MR/patternapply.R | 2++
3 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/NAMESPACE b/NAMESPACE @@ -1,2 +1,5 @@ # Generated by roxygen2: do not edit by hand +S3method(as.data.frame,replacement_list) +S3method(as.matrix,replacement_list) +export(patternapply) diff --git a/R/generics.R b/R/generics.R @@ -5,6 +5,8 @@ #' #' @return A character matrix. Each row corresponds to an entry in the #' replacement_list. +#' +#' @export #' #' @method as.matrix replacement_list as.matrix.replacement_list <- function(x) { @@ -31,6 +33,8 @@ as.matrix.replacement_list <- function(x) { #' @return A data.frame. Each row corresponds to an entry in the #' replacement_list. #' +#' @export +#' #' @method as.data.frame replacement_list as.data.frame.replacement_list <- function(x) { return(as.data.frame.matrix(as.matrix.replacement_list(x))) diff --git a/R/patternapply.R b/R/patternapply.R @@ -22,6 +22,8 @@ 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)))) {