Rlang-QQ-0.0.0.1: quasiquoter for inline-R code

Safe HaskellNone

RlangQQ.Internal

Contents

Synopsis

Documentation

r :: QuasiQuoterSource

Calls R with the supplied string. Variables in R prefixed hs_ cause the corresponding (un-prefixed) variable to be converted. The variable(s) must be in the class ToRVal.

For example, when this file http://code.haskell.org/~aavogt/examples/test.hs is run

 
 import RlangQQ

 x = [0 .. 10  :: Double]
 y = map (sin . (*pi) . (/10)) x

 main = do
   [r|
     library(ggplot2)
     png(file='test.png')
     plot(qplot( hs_x, hs_y ))
     dev.off()
     |]

The file is produced

converting R's AST

hsVars :: Tree String -> [String]Source

gets variables like abc provided the R file contained hs_abc

classes for marshalling data

haskell -> R

class ToRVal a whereSource

Methods

toRValSource

Arguments

:: String

variable name

-> a 
-> ByteString 

R -> haskell

class FromRVal a whereSource

not used yet

Methods

fromRVal :: ByteString -> aSource

Instances