trig_radian_check: Check that argument is in radians

Description Usage Arguments Examples

View source: R/trig_radian_check.R

Description

Check that argument is in radians

Usage

1
2
3
trig_radian_check(ex, radian_val,
  fail = "could not find call to a trigonometric function", pass = "",
  eps = 0.001)

Arguments

ex

A checkr_result, presumably containing a call to a trig function.

radian_val

a number: the desired angle in radians

fail

character string message to produce on failure

pass

character string message to produce on pass (and switches output action from OK to pass.)

eps

precision of comparison

Examples

1
2
3
4
ex <- for_checkr(quote(15 * sin(3)))
trig_radian_check(ex, 3)
trig_radian_check(ex, 3 * pi / 180)
trig_radian_check(ex, 4*pi/180)

dtkaplan/checkr2 documentation built on May 17, 2019, 4:01 p.m.