README.md

mod::ule

AppVeyor build
status Travis build
status codecov CRAN
status CRAN
License Lifecycle:
maturing

The mod package provides a simple and friendly way to structure program and data into flexible and independent units for programming and interactive use. Modules indtroduced by the mod package offer merits and conveniences currently absent from R.

Why?

Programs need to be oraganized into units.

A package is a very robust solution, but is formal and compliated; packages require additional knowledge to R and must be installed in the local library by install.packages(); it is not easy to manage different versions of the same package. On the other hand, simple R scripts, often executed by source(), are brittle and may create namespace conflict; They are unsuitable for building tools and applications.

Modules fills the hollow middleground by allowing programs to live separately and work together at the same time. Each module has its own scope, host is own objects, an can each use different packages without interefering with each other or the user’s global search path. They can be created either inline along other programs or from a standalone file, and can be used in the user’s working environment, as a part of a package, or in other modules.

Installation

Install the published version from CRAN with:

install.packages("mod")

Install the development version from GitHub with:

devtools::install_github("iqis/mod")

Vocabulary

The mod package has a simple UI:

Quickstart


my_numbers <- mod::ule({
        numbers <- c(1,2,2,2,3,3,4,5,6)
})

my_plot <- mod::ule({
        refer(my_numbers)
        numbers_plot <- function(x = numbers) {
                plot(x, col = "purple", pch = 15)
                title("Numbers", ylab = "Value")
        }
})

my_numbers$numbers
#> [1] 1 2 2 2 3 3 4 5 6
my_plot$numbers_plot()

Documentation

mod website



iqis/ntr documentation built on Dec. 7, 2019, 10:20 p.m.