https://github.com/gastonstat/tester
R package tester
https://github.com/gastonstat/tester
Last synced: 3 months ago
JSON representation
R package tester
- Host: GitHub
- URL: https://github.com/gastonstat/tester
- Owner: gastonstat
- Created: 2013-06-30T16:45:16.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-08-28T21:45:46.000Z (over 9 years ago)
- Last Synced: 2024-08-13T07:15:08.555Z (6 months ago)
- Language: R
- Size: 223 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - gastonstat/tester - R package tester (R)
README
# `"tester"`
**tester** provides human readable functions to test characteristics of some common [R](http://www.r-project.org/) 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](http://www-cs-faculty.stanford.edu/~uno/lp.html) paradigm.
Without `tester`: If you want to test if a number is positive, you would do something like this:
```ruby
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:
```ruby
# 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](http://cran.r-project.org/web/packages/tester/index.html):
```ruby
install.packages('tester')
```Development version on [github](https://github.com/gastonstat/tester):
```ruby
library(devtools)
install_github('tester', 'gastonstat')
```## Some examples
```ruby
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](http://www.gastonsanchez.com)Gaston Sanchez (`gaston.stat at gmail.com`)