install.packages(c("reticulate"))
Programming with Python with reticulate
Introduction to using Python in R and the reticulate package
Pre-lecture activities
Important
In advance of class, please install:
reticulate
- this provides an interface between R and python
You can do this by calling
In addition, please read through the pre-reading:
And if there is time, these are useful too:
Lecture
Acknowledgements
Material for this lecture was borrowed and adopted from
Learning objectives
Learning objectives
At the end of this lesson you will:
- Install the
reticulate
R package on your machine (I’m assuming you have python installed already) - Learn about
reticulate
to work interoperability between Python and R - Be able to translate between R and Python objects
Slides
Class activity
For the rest of the time in class, you and your team will work on the final project. Stephanie will walk around to answer questions and to help in anyway I can.
Post-lecture
Additional practice
Here are some additional practice questions to help you think about the material discussed.
Questions
- Try to use tab completion for a function.
- Try to install and load a different python module in R using
import()
.