API for com.evocomputing.rincanter

by Joel Boehland

Usage:
(ns your-namespace
  (:require com.evocomputing.rincanter))

Overview

Rincanter is a Clojure/incanter wrapper around the rosuda
JRIEngine Java/R bridge. The hope is to allow easy access to an
embedded R engine from incanter. It also offers conversion between
Clojure/incanter datatypes and R datatypes such as R dataframe to
incanter dataset.

Public Variables and Functions



get-jri-engine

function
Usage: (get-jri-engine)
Get the jri-engine. If it doesn't exist, create it using the
default init-jri-engine function and return it.
Source


init-jri-engine

function
Usage: (init-jri-engine)
       (init-jri-engine handler)
Initialize the jri engine. This can only be done once in the
lifetime of the jvm-- not our rules- that's how the embedded R engine
seems to want things.
Source


r-eval

function
Usage: (r-eval expression)
Eval expression in the R engine. Convert the return value from
JRI/R to Clojure
Source


r-eval-no-catch

function
Usage: (r-eval-no-catch expression)
Eval expression in the R engine. Will not catch any exceptions that
happen during evaluation
Source


r-eval-raw

function
Usage: (r-eval-raw expression)
Eval expression in the R engine. Just return the raw JRI/R wrapper,
don't convert to Clojure object
Source


r-get

function
Usage: (r-get r-name)
Retrieve the value with this name in the R engine
Source


r-get-raw

function
Usage: (r-get-raw r-name)
Retrieve the value with this name in the R engine
Source


r-set!

function
Usage: (r-set! r-name val)
Assign r-name to val within the R engine
Source


r-try-parse-eval

function
Usage: (r-try-parse-eval expression)
Eval expression in the R engine, wrapped (on the R side) in
try/catch. Will catch errors on the R side and convert to Exception
and throw
Source


with-r-eval

macro
Usage: (with-r-eval & forms)
Evaluate forms that are string using r-eval, otherwise, just eval
Clojure code normally
Source


with-r-eval-no-catch

macro
Usage: (with-r-eval-no-catch & forms)
Evaluate forms that are string using r-eval-no-catch, otherwise, just eval
clojure code normally
Source


with-r-eval-raw

macro
Usage: (with-r-eval-raw & forms)
Evaluate forms that are string using r-eval-raw, otherwise, just eval
Clojure code normally
Source


with-r-try-parse-eval

macro
Usage: (with-r-try-parse-eval & forms)
Evaluate forms that are string using r-try-parse-eval, otherwise
just eval Clojure code normally
Source

com.evocomputing.rincanter.convert

Convert between the rosuda Java/R wrapper types and Clojure types


dataframe?

function
Usage: (dataframe? rexp)
Returns true if the passed in object is an R dataframe, false
otherwise
Source

def-from-r

macro
Usage: (def-from-r rexp type & convert-forms)
Define a from-r method using standard boilerplate
Source

from-r

multimethod
No usage documentation available
Convert the rosuda JRI/R type to a matching Clojure type
Source

prefer-primitive-type

function
Usage: (prefer-primitive-type class)
If possible, ensure array is one of the primitive types. Convert if neccessary
Source

r-attr

function
Usage: (r-attr rexp attr-name)
Returns the attribute with the passed in name, or nil.
Source

r-attr-names

function
Usage: (r-attr-names rexp)
Return a seq of attributes, or nil if the REXP has no attributes
Source

r-atts

function
Usage: (r-atts rexp)
Returns a map of the R object's attribute-names -> attributes, or nil.
Source

r-atts-raw

function
Usage: (r-atts-raw rexp)
Returns the JRI object representing the R attributes for this object
or nil if there are no attributes
Source

r-has-attr?

function
Usage: (r-has-attr? rexp attr-name)
Returns true if the attribute with the passed in name exists, or false.
Source

r-map-to-atts

function
Usage: (r-map-to-atts attr-map)
Converts a map into the nested list form that rosuda JRI seems to
want in its constructors
Source

r-true

function
Usage: (r-true seq)
Most R variables are collections. This tests a sequence for
equality with 1 or boolean true. Returns true if all equal 1 or true, false otherwise
Source

to-r

multimethod
No usage documentation available
Convert the Clojure type to the proper rosuda JRI/R type
Source
Logo & site design by Tom Hickey.
Clojure auto-documentation system by Tom Faulhaber.