inline-r-0.9.1: Seamlessly call R from Haskell and vice versa. No FFI required.

Copyright2013 (C) Amgen Inc
Safe HaskellNone
LanguageHaskell2010

Language.R

Contents

Description

Wrappers for low-level R functions.

Synopsis

Documentation

module Foreign.R

Evaluation

eval :: MonadR m => SEXP s a -> m (SomeSEXP (Region m)) Source #

Evaluate a (sequence of) expression(s) in the global environment.

eval_ :: MonadR m => SEXP s a -> m () Source #

Silent version of eval function that discards it's result.

evalEnv :: MonadR m => SEXP s a -> SEXP s Env -> m (SomeSEXP (Region m)) Source #

Evaluate a (sequence of) expression(s) in the given environment, returning the value of the last.

install :: MonadR m => String -> m (SEXP V Symbol) Source #

Internalize a symbol name.

cancel :: IO () Source #

Cancel any ongoing R computation in the current process. After interruption an RError exception will be raised.

This call is safe to run in any thread. If there is no R computation running, the next computaion will be immediately cancelled. Note that R will only interrupt computations at so-called "safe points" (in particular, not in the middle of a C call).

Exceptions

throwR Source #

Arguments

:: MonadR m 
=> SEXP s Env

Environment in which to find error.

-> m a 

Throw an R error as an exception.

throwRMessage :: MonadR m => String -> m a Source #

Throw an R exception with specified message.

Deprecated

parseFile :: FilePath -> (SEXP s Expr -> IO a) -> IO a Source #

Deprecated: Use [r| parse(file="pathtofile") |] instead.

Parse file and perform some actions on parsed file.

This function uses continuation because this is an easy way to make operations GC-safe.

parseText Source #

Arguments

:: String

Text to parse

-> Bool

Whether to annotate the AST with source locations.

-> IO (SEXP V Expr) 

Deprecated: Use [r| parse(text=...) |] instead.

string :: String -> IO (SEXP V Char) Source #

Deprecated: Use mkSEXP instead

Create an R character string from a Haskell string.

strings :: String -> IO (SEXP V String) Source #

Deprecated: Use mkSEXP instead

Create an R string vector from a Haskell string.