From 4a86b56f1f1965d54bff76e02cab171b211e1f6e Mon Sep 17 00:00:00 2001 From: John Kirkpatrick <133956382+Puzzled-Face@users.noreply.github.com> Date: Tue, 10 Oct 2023 12:39:18 +0100 Subject: [PATCH] remove %~% (#689) * remove %~% * Fixing NAMESPACE --- NAMESPACE | 1 - R/helpers.R | 7 ------- examples/matching-tolerance.R | 9 --------- man/matchTolerance.Rd | 19 ------------------- 4 files changed, 36 deletions(-) delete mode 100644 examples/matching-tolerance.R diff --git a/NAMESPACE b/NAMESPACE index 8225f5d32..82edc104e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,7 +1,6 @@ # Generated by roxygen2: do not edit by hand export("%>%") -export("%~%") export(.CohortSizeConst) export(.CohortSizeDLT) export(.CohortSizeMax) diff --git a/R/helpers.R b/R/helpers.R index 38448d6ed..21273195d 100644 --- a/R/helpers.R +++ b/R/helpers.R @@ -80,7 +80,6 @@ positive_number <- setClass( ##' ##' @export ##' @keywords programming -##' @example examples/matching-tolerance.R matchTolerance <- function(x, table) { if (length(table) == 0) { return(integer()) @@ -97,12 +96,6 @@ matchTolerance <- function(x, table) { })) } -##' @describeIn matchTolerance Helper function for checking inclusion in a table with tolerance -##' @export -`%~%` <- function(x, table) { - !is.na(matchTolerance(x = x, table = table)) -} - ##' checks for whole numbers (integers) ##' ##' @param x the numeric vector diff --git a/examples/matching-tolerance.R b/examples/matching-tolerance.R deleted file mode 100644 index d6344adca..000000000 --- a/examples/matching-tolerance.R +++ /dev/null @@ -1,9 +0,0 @@ -myDose <- c(rep(0.030, 6), rep(0.050, 3), rep(0.075, 4), rep(0.1, 9), rep(0.15, 7)) -doseGrid <- seq(from = .025, to = .15, by = .005) - -myDose %in% doseGrid -matchTolerance(myDose, doseGrid) -myDose %~% doseGrid - -matchTolerance(c(myDose, 500), doseGrid) -c(myDose, 500) %~% doseGrid diff --git a/man/matchTolerance.Rd b/man/matchTolerance.Rd index cd8dd4551..6c7aa6e0e 100644 --- a/man/matchTolerance.Rd +++ b/man/matchTolerance.Rd @@ -2,12 +2,9 @@ % Please edit documentation in R/helpers.R \name{matchTolerance} \alias{matchTolerance} -\alias{\%~\%} \title{Helper function for value matching with tolerance} \usage{ matchTolerance(x, table) - -x \%~\% table } \arguments{ \item{x}{the values to be matched} @@ -21,20 +18,4 @@ empty vector if \code{table} is empty. \description{ This is a modified version of \code{match} that supports tolerance. } -\section{Functions}{ -\itemize{ -\item \code{x \%~\% table}: Helper function for checking inclusion in a table with tolerance - -}} -\examples{ -myDose <- c(rep(0.030, 6), rep(0.050, 3), rep(0.075, 4), rep(0.1, 9), rep(0.15, 7)) -doseGrid <- seq(from = .025, to = .15, by = .005) - -myDose \%in\% doseGrid -matchTolerance(myDose, doseGrid) -myDose \%~\% doseGrid - -matchTolerance(c(myDose, 500), doseGrid) -c(myDose, 500) \%~\% doseGrid -} \keyword{programming}