First Post !

May 9, 2021   

Introduction to Python and R for Computational Biology

In Computational Biology we briefly learned about Python and how it works alongside the programming language R. R is a great programming language because its functions are formatted so that data can be easily manipulated, analyzed, and visualized. Python has a useful library that imitates many essential features in R called Pandas. Since the two languages are widely used in the fields of statistical analysis, many programmers utilize both for projects. As such, it is important to be able to communicate between the two.

Reticulate Package

Reticulate is a package in R that includes a Python engine for R Markdown, so programmers can code Python chunks alongside R chunks. Below is a simple example of an R code chunk and Python code chunk and how they can be integrated to construct a final product.

# R chunk
library(reticulate)

intro <- "Hey there, I hope your day is"
# Python chunk
intro = "amazing!!"

# r. is used to access R-defined objects
print(r.intro, intro)
## Hey there, I hope your day is amazing!!



comments powered by Disqus