matchTolerance: Helper function for value matching with tolerance

Description Usage Arguments Value Functions Examples

View source: R/helpers.R

Description

This is a modified version of match that supports tolerance.

Usage

1
2
3

Arguments

x

the values to be matched

table

the values to be matched against

Value

A vector of the same length as x or empty vector if table is empty.

Functions

Examples

1
2
3
4
5
6
7
8
9
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

0liver0815/onc-crmpack-test documentation built on Feb. 19, 2022, 12:25 a.m.