Skip to content

Instantly share code, notes, and snippets.

@lgautier
Created December 26, 2014 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lgautier/e2e8709776e0e0e93b8d to your computer and use it in GitHub Desktop.
Save lgautier/e2e8709776e0e0e93b8d to your computer and use it in GitHub Desktop.
# This is a setup snippet for an ipython notebook.
# It requires the presence of variable 'setup_digest',
# defined in the cell controlling the setup.
if 'setup_digest' not in locals():
import rpy2
%load_ext rpy2.ipython
# pigheaded / slow rpy2 developpers,
# customize away:
from rpy2.robjects.conversion import ri2py
from rpy2.ipython.rmagic import ri2ipython
ri2ipython.register(rpy2.robjects.Sexp, ri2py)
# HTML rendering of rpy2 objects
from rpy2.ipython.html import init_printing, css, HTML
init_printing()
print('Setup complete (cell below).')
else:
print('Setup already performed.')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment