rpy2 - R in Python

on Pypi

About

rpy2 is an interface to R running embedded in a Python process.

The project is mature, stable, documented, and widely used.

License

The same license as R: GPLv2 or greater.

Questions and issues

Consider having a look at the documentation. Otherwise wuestions should preferably be asked on the rpy mailing-list on SourceForge, or on StackOverflow. Bugs, or wishes, can also go to the bitbucket page for the project.

Time travel

If looking for rpy or the old website, it was moved to here.

Source and installation

pip

Released source packages are available on PyPi. Installing should be as easy as

pip install rpy2

Docker

A Docker image is also available to "kick the tires". To run the current release with

a Jupyter notebook (on port 8888):
docker run --rm -p 8888:8888 \
       rpy2/rpy2:2.8.x
an ipython console:
docker run -it --rm -p 8888:8888 \
       rpy2/rpy2:2.8.x ipython
Code repository

The source code is also in a public repository on bitbucket.

Documentation

More information can be found in the documentation.

Additional resources, about rpy2 in particular or demonstrations of polyglot data analysis using rpy2 to call R from Python, are available (don't hesitate to notify us about other resource, but avoid Python vs R trolls... unless funny):

rpy2 in the wild

The package is used in a wide range of domains. For example:

  • Haslwanter, Thomas. An Introduction to Statistics with Python. Springer, 2016.
  • Ekmekci, Berk, Charles E. McAnany, and Cameron Mura. "An Introduction to Programming for Bioscientists: A Python-Based Primer." PLoS Comput Biol 12.6 (2016): e1004867.
  • Analyzing genomics data at scale with R, AWS Lambda and Amazon API gateway (AWS Compute Blog)
  • Anaya, Jordan. "OncoLnc: Linking TCGA survival data to mRNAs, miRNAs, and lncRNAs." PeerJ PrePrints 4 (2016): e1780v1.
  • Cleland, Edward John, et al. "The bacterial microbiome in chronic rhinosinusitis: Richness, diversity, postoperative changes, and patient outcomes." American journal of rhinology & allergy 30.1 (2016): 37-43.
  • Vandenbulcke, Hélène, et al. "Alcohol intake increases the risk of hepatocellular carcinoma in patients with hepatitis C virus-related compensated cirrhosis: a prospective study." Journal of hepatology (2016).
  • Jeong, Seongwoon, et al. "A NoSQL Data Management Infrastructure for Bridge Monitoring." (2016).
  • Kenah, Eben, et al. "Molecular Infectious Disease Epidemiology: Survival Analysis and Algorithms Linking Phylogenies to Transmission Trees." PLoS Comput Biol 12.4 (2016): e1004869.
  • Kittas, Aristotelis, et al. "Organizational principles of the Reactome human BioPAX model using graph theory methods." Journal of Complex Networks (2016): cnw003.
  • Zhang, Zhi-Min, et al. "Multiscale peak detection in wavelet space." Analyst 140.23 (2015): 7955-7964.
  • Woon, Wei Lee, et al. "Changes in Occupational Skills-A Case Study Using Non-negative Matrix Factorization." Neural Information Processing. Springer International Publishing, 2015.
  • Antao, Tiago. Bioinformatics with Python cookbook. Packt Publishing Ltd, 2015.
  • Terna, Pietro. "Introducing the Swarm-Like Agent Protocol in Python (SLAPP)." Agent-based Models of the Economy. Palgrave Macmillan UK, 2015. 31-54.
  • Nakamura, Kunio, et al. "Correlation between brain volume change and T2 relaxation time induced by dehydration and rehydration: implications for monitoring atrophy in clinical studies." NeuroImage: Clinical 6 (2014): 166-170.
  • Filosi, Michele, et al. "ReNette: a web-infrastructure for reproducible network analysis." bioRxiv (2014): 008433.
  • Angeli, Nicole F., et al. A process to support species conservation planning and climate change readiness in protected areas. No. e492v2. PeerJ PrePrints, 2014.
  • Röst, Hannes L., et al. "pyOpenMS: A Python‐based interface to the OpenMS mass‐spectrometry algorithm library." Proteomics 14.1 (2014): 74-77.
  • Heavey, Cathal, et al. "Development of an open-source discrete event simulation cloud enabled platform." Proceedings of the 2014 Winter Simulation Conference. IEEE Press, 2014.
  • De Melo, Vinícius Veloso. "Kaizen programming." Proceedings of the 2014 conference on Genetic and evolutionary computation. ACM, 2014.
  • Onggo, B. S., et al. "TOWARDS AUTOMATED SIMULATION INPUT DATA." 8TH SIMULATION WORKSHOP. 2014.
  • Via, Allegra, Kristian Rother, and Anna Tramontano. Managing Your Biological Data with Python. CRC Press, 2014.
  • Brown, Robert A., Sridar Narayanan, and Douglas L. Arnold. "Imaging of repeated episodes of demyelination and remyelination in multiple sclerosis." NeuroImage: Clinical 6 (2014): 20-25.
  • Krishnan, Hari, et al. "Exploring Collaborative HPC Visualization Workflows using VisIt and Python." Proceedings of the 12th Python in Science Conference (SciPy 2013). 2013.
  • Parks, Donovan H., et al. "GenGIS 2: Geospatial analysis of traditional and genetic biodiversity, with new gradient algorithms and an extensible plugin framework." PloS one 8.7 (2013): e69885.
  • Harper, Marc, and Christopher J. Lee. "Genome-wide analysis of mutagenesis bias and context sensitivity of N-methyl-N′-nitro-N-nitrosoguanidine (NTG)." Mutation Research/Fundamental and Molecular Mechanisms of Mutagenesis 731.1 (2012): 64-67.
  • Strickland, C. M., et al. "PyMCMC: A Python Package for Bayesian Estimation Using Markov Chain Monte Carlo." (2012).
  • Vitolo, Claudia, W. O. U. T. E. R. Buytaert, and D. Reusser. "Hydrological Models as Web Services: An Implementation Using OGC Standards." Proceedings of the 10th International Conference on Hydroinformatics, HIC, Hamburg, Germany. 2012.
  • Talevich, Eric, et al. "Bio. Phylo: A unified toolkit for processing, analyzing and visualizing phylogenetic trees in Biopython." BMC bioinformatics 13.1 (2012): 1.
  • Bagger, Frederik Otzen, et al. "HemaExplorer: a database of mRNA expression profiles in normal and malignant haematopoiesis." Nucleic acids research (2012): gks1021.
  • Buske, Orion J., et al. "Exploratory analysis of genomic segmentations with Segtools." BMC bioinformatics 12.1 (2011): 1.
  • Tolk, A., et al. "TOWARDS AUTOMATED SIMULATION INPUT DATA: AN OPEN SOURCE TOOL TO ENHANCE THE INPUT DATA PHASE IN DISCRETE EVENT SIMULATION."
  • Patton, Evan W., et al. "SemNExT: A Framework for Semantically Integrating and Exploring Numeric Analyses."
  • Connolly, Daniel W., et al. "Integrating R efficiently to allow secure, interactive analysis within a clinical data warehouse." The 8th International R User Conference. Vanderbilt University.
  • Masica, David L., and Rachel Karchin. "Correlation of somatic mutation and expression identifies genes important in human glioblastoma progression and survival." Cancer research 71.13 (2011): 4550-4561.
  • Simone, James. "PoS (Lattice 2011) 048 Data analysis using the Gnu R system for statistical computation." (2011).
  • Liu, Sanmin, et al. "HDX-analyzer: a novel package for statistical analysis of protein structure dynamics." BMC bioinformatics 12.1 (2011): 1.
  • Roseline, Bilina, and Steve Lawford. "Python for Unified Research in Econometrics and Statistics." Available at SSRN 1429822 (2009).
  • Wijffels, Jan. "Prediction and Fuzzy Logic at ThomasCook to automate price settings of last minute offers." (2009).
  • McBeth, Rafe. "Computational investigation of biological dose-volume outcome predictors in 29 canine nasal tumor patients treated with stereotactic radiation therapy." (2007).