diff --git a/Setup.hs b/Setup.hs
new file mode 100644
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain
diff --git a/ihaskell-inline-r.cabal b/ihaskell-inline-r.cabal
new file mode 100644
--- /dev/null
+++ b/ihaskell-inline-r.cabal
@@ -0,0 +1,27 @@
+name:                ihaskell-inline-r
+version:             0.1.0.0
+synopsis:            Embed R quasiquotes and plots in IHaskell notebooks.
+homepage:            https://tweag.github.io/HaskellR/
+license:             BSD3
+author:              Mathieu Boespflug, Alexander Vershilov
+maintainer:          Alexander Vershilov <alexander.vershilov@tweag.io>
+copyright:           Copyright (c) 2015, Tweag I/O Limited.
+category:            Development
+build-type:          Simple
+cabal-version:       >=1.10
+
+library
+  exposed-modules:     IHaskell.Display.InlineR
+  build-depends:       base >=4.7 && <5
+                      ,inline-r >= 0.6.0.1
+                      ,ihaskell
+                      ,ihaskell-blaze
+                      ,filepath
+                      ,blaze-html
+                      ,bytestring
+                      ,base64-bytestring
+                      ,template-haskell
+                      ,temporary >= 1.2
+  hs-source-dirs:      src
+  default-language:    Haskell2010
+  ghc-options:         -Wall
diff --git a/src/IHaskell/Display/InlineR.hs b/src/IHaskell/Display/InlineR.hs
new file mode 100644
--- /dev/null
+++ b/src/IHaskell/Display/InlineR.hs
@@ -0,0 +1,48 @@
+-- |
+-- Copyright: 2015 (C) Tweag I/O Limited
+
+{-# LANGUAGE QuasiQuotes #-}
+{-# LANGUAGE TemplateHaskell #-}
+{-# OPTIONS_GHC -fno-warn-missing-fields #-}
+module IHaskell.Display.InlineR
+  ( r
+  , rprint
+  , rgraph
+  , Language.R.Instance.runRegion
+  ) where
+
+import           Control.Applicative
+import           Control.Monad (when)
+import qualified Data.ByteString as BS
+import qualified Data.ByteString.Base64 as Base64
+import qualified Data.ByteString.Char8 as Char
+import           Data.Monoid
+import           H.Prelude.Interactive as H -- we use provide instances to IO Monad
+import           IHaskell.Display
+import           IHaskell.Display.Blaze () -- to confirm it's installed
+import           Language.Haskell.TH.Quote
+import           Language.R.Instance
+import           Language.R.QQ
+import           System.IO (hClose)
+import           System.IO.Temp (withSystemTempFile)
+import qualified Text.Blaze.Html5 as BH
+import qualified Text.Blaze.Html5.Attributes as BH
+
+rprint :: QuasiQuoter
+rprint = QuasiQuoter { quoteExp = \s -> [| do H.p $(quoteExp r s) |] }
+
+rgraph :: QuasiQuoter
+rgraph = QuasiQuoter { quoteExp = \s ->
+    [| withSystemTempFile "ihaskell-inline-r-.png" $ \path h -> do
+          hClose h
+          _ <- [r| png(filename=path_hs, width=480, height=480, bg="white"); |]
+          H.p $(quoteExp r s)
+          _ <- [r| dev.off() |]
+          encoded <- Base64.encode <$> BS.readFile path
+          when (BS.null encoded) $
+            fail "No graphical output."
+          display $
+            BH.img BH.!
+              BH.src (BH.unsafeByteStringValue
+                        (Char.pack "data:image/png;base64," <> encoded))
+     |] }
