assertive.numbers v0.02
Monthly downloads
Assertions to Check Properties of Numbers
A set of predicates and assertions for checking the properties of
numbers. This is mainly for use by other package developers who want to
include runtime testing features in their own packages. Endusers will
usually want to use assertive directly.
Readme
assertive.numbers
A set of predicates and assertions for checking the properties of numbers. Most of the documentation is on the assertive page. Endusers will usually want to use assertive directly.
Installation
To install the stable version, type:
install.packages("assertive.numbers")
To install the development version, you first need the devtools package.
install.packages("devtools")
Then you can install the assertive.numbers package using
library(devtools)
install_bitbucket("richierocks/assertive.numbers")
Predicates
is_even
and is_odd
check for even or odd numbers. is_divisible_by
generalizes the concept.
is_finite
, is_infinite
, is_negative_infinity
, and is_positive_infinity
check for infiniteness.
is_nan
and is_not_nan
check for NaN
(or not).
is_in_range
checks for numbers in a range. is_in_closed_range
, is_in_open_range
, is_in_left_open_range
, is_in_right_open_range
, is_negative
, is_non_negative
, is_positive
, is_non_positive
, is_percentage
, and is_proportion
provide more specialized alternatives.
is_imaginary
and is_real
check for imaginary or real numbers.
is_whole_number
check for whole numbers.
is_equal_to
, is_not_equal_to
, is_greater_than
, is_greater_than_or_equal_to
, is_less_than
, and is_less_than_or_equal_to
check relational operators.
Assertions
Predicates all return a vector and have two corresponding assertions. For example, is_even
has assert_all_are_even
and assert_any_are_even
.
Functions in assertive.numbers
Name  Description  
assert_all_are_finite  Are the inputs (in)finite?  
assert_all_are_nan  Is the input (not) NaN?  
assert_all_are_in_closed_range  Is the input in range?  
assert_all_are_imaginary  Is the input real/imaginary?  
assert_all_are_equal_to  How does the input relate to a value?  
assert_all_are_divisible_by  Is the input divisible by a number?  
assert_all_numbers_are_whole_numbers  Is the input a whole number?  
No Results! 
Last month downloads
Details
Type  Package 
Date  20160505 
URL  https://bitbucket.org/richierocks/assertive.numbers 
BugReports  https://bitbucket.org/richierocks/assertive.numbers/issues 
License  GPL (>= 3) 
LazyLoad  yes 
LazyData  yes 
Acknowledgments  Development of this package was partially funded by
the Proteomics Core at Weill Cornell Medical College in Qatar

Collate  'assertisdivisibleby.R' 'assertisequalto.R' 'imports.R' 'assertisinrange.R' 'assertisinfinitynan.R' 'assertisrealimaginary.R' 'assertiswholenumber.R' 'isdivisibleby.R' 'isequalto.R' 'isinrange.R' 'isinfinitynan.R' 'isrealimaginary.R' 'iswholenumber.R' 
RoxygenNote  5.0.1 
NeedsCompilation  no 
Packaged  20160509 16:36:28 UTC; richie 
Repository  CRAN 
Date/Publication  20160509 21:37:47 
imports  assertive , assertive.base (>= 0.02) 
depends  base (>= 3.0.0) , R (>= 3.0.0) 
suggests  testthat 
Contributors  Richard Cotton 
Include our badge in your README
[![Rdoc](http://www.rdocumentation.org/badges/version/assertive.numbers)](http://www.rdocumentation.org/packages/assertive.numbers)