Learn R Programming

Rdrools (version 1.0.3)

Rdrools-package: A Rules Engine for R based on the popular Java based Drools

Description

Rdrools is a robust rules engine based on the popular BRMS (Business Rule Management System) Drools written in Java. Rules make it easy to express solutions to different problems. They are often expressed as declarative elements of logic and are held in a file repository, separate from the production code, so that modifying the logic becomes easier. In Rdrools, rules are written in the native business readable DRL format, which is understood by drools. If you are not familiar, please go through the Drools documentation provided in the list of references below.

Arguments

Details

Package: Rdrools
Type: Package
Version: 1.0.3
Date: 2018-02-23
License: Apache License 2.0
LazyLoad: yes
LazyData: yes
Drools: 6.5.0.Final
JDK: >= 1.7

Rdrools is fairly straightforward to use. It expects the user to provide a data frame as an input, a rules file, and a comma separated list of input and output columns. Rdrools then picks a row from the data frame, applies the rules provided to it and maps the output to the list of expected output columns. Incorrect inputs would throw a meaningful error. Rules syntax should be compatible with the drools version used in the package. The package does not require a separate drools installation.

References

Drools Homepage, Drools Documentation

See Also

rulesSession, runRules

Examples

Run this code
# NOT RUN {
library(Rdrools)
data(class)
data(rules)
input.columns<-c('name', 'class', 'grade', 'email')
output.columns<-c('address', 'subject', 'body')
rules.session<-rulesSession(rules, input.columns, output.columns)
output.df<-runRules(rules.session, class)
# }

Run the code above in your browser using DataLab