R package tester
R
Latest commit 863cb58 Aug 29, 2015 @gastonstat version 0.1.9
Permalink
Failed to load latest commit information.
R version 0.1.9 Aug 28, 2015
inst/tests add vignette Jul 11, 2013
man version 0.1.9 Aug 28, 2015
vignettes add tall and wide Nov 25, 2013
.Rbuildignore adding is_single Oct 22, 2013
DESCRIPTION version 0.1.9 Aug 28, 2015
NAMESPACE version 0.1.9 Aug 28, 2015
README.md rubyfy README Jul 13, 2013

README.md

"tester"

tester provides human readable functions to test characteristics of some common R objects. The main purpose behind tester is to help you validate objects, especially for programming and developing purposes (e.g. creating R packages)

Motivation

I developed tester to have a set of functions for testing objects in a friendly way, following the so-called literate programming paradigm.

Without tester: If you want to test if a number is positive, you would do something like this:

number = 10
if (number > 0) TRUE else FALSE

With tester: There is nothing wrong with the previous way of doing things. However, I still wanted to be able to type something like this:

# another way
is_positive(number)

This is what tester offers you. By having functions like is_positive(), it helps your code to be more understandable. The underlying principle is to have tools that get you closer to the literate programming paradigm. That was my purpose for developing tester

Installation

Stable version on CRAN:

install.packages('tester')

Development version on github:

library(devtools)
install_github('tester', 'gastonstat')

Some examples

library(tester)

# positive
is_positive(5)
is_positive(0)
is_positive(-3)

# negative
is_negative(5)
is_negative(0)
is_negative(-3)

# integer
is_integer(pi)
is_integer(1)
is_integer(1L)
is_integer(1.0)
is_integer(1.1)

# compared to 'is.integer'
is.integer(1L)
is.integer(1)
is.integer(as.integer(1))
is.integer(1.0)
is.integer(1.1)

Author Contact

www.gastonsanchez.com

Gaston Sanchez (gaston.stat at gmail.com)