Rewriting your R analysis code in Python
summary
Rewriting is worth it when maintainability or integration demands outweigh fragile R idioms: code converts to Python using pandas and numpy but grouping can produce nested DataFrames where R returns one table, and tidyverse pipes and R’s nonstandard evaluation (quoting) have no direct equivalent. Interop options actually work: reticulate and rpy2 let code call across languages but can misconvert types or timezones, and packaging or C++ extensions use the usual helpers.
AI-written summary · about
chapters (19)
- 0:00Intro
- 0:29About me
- 1:19When to rewrite your code
- 2:49When not to rewrite your code
- 4:04Strengths of R
- 5:31Strengths of python
- 6:33Differences - easy ones
- 7:51Why switch from R to python?
- 9:08Data analysis
- 10:22Pipes
- 14:28objects and classes
- 15:48Reference Class
- 18:53Python Class
- 20:32library vs import
- 21:42args, **kwargs
- 23:54Quoting/non-standard evaluation
- 27:07Quoting is used all the time
- 28:16Combine best of both worlds
- 31:19Thank you! Questions?
related talks
17mPolyglot Data Science: Why and How to Combine R and Python
32mInterfacing R and Python
35mEffective Python and R collaboration
22mUsing Python & R in Harmony
45mPython useRs
15mAchieving a seamless workflow between R, Python and SAS from within RStudio
18mYes, you can use Python with RStudio Team!
15mAchieving a seamless workflow between R, Python and SAS from within RStudio
