Skip to content

Commit

Permalink
Add January 2020 talk
Browse files Browse the repository at this point in the history
  • Loading branch information
johnpeach committed Jan 28, 2020
1 parent a92f0fb commit b8f2d74
Show file tree
Hide file tree
Showing 9 changed files with 121,445 additions and 0 deletions.
5 changes: 5 additions & 0 deletions 2020-01-28_reticulate/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Using R and Python Together with Reticulate

R and Rstudio are great for workflows in statistics and data science, but what if you need to use a library that's only available in Python? What if your collaborators work in Python and you work primarily in R (or vice versa)? How might you share code and make it so your workflows come together? The `reticulate` package helps with these issues and can make bringing together R and Python a joy.

Surely the folks at [RStudio](https://rstudio.github.io/reticulate/index.html) are the best source of information about this recent thrust in interoperability, however, after getting a feel for `reticulate` and how it might fit into my own workflow I'm happy to share a point of view about how to add this powerful tool to your own data science toolbox.
Binary file not shown.
18,250 changes: 18,250 additions & 0 deletions 2020-01-28_reticulate/avocado.csv

Large diffs are not rendered by default.

1,860 changes: 1,860 additions & 0 deletions 2020-01-28_reticulate/oc_rug_reticulate-rpubs.html

Large diffs are not rendered by default.

Binary file added 2020-01-28_reticulate/oc_rug_reticulate.pdf
Binary file not shown.
31 changes: 31 additions & 0 deletions 2020-01-28_reticulate/setup_reticulate.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# The only package you'll need installed ahead of time is pacman.
# install.packages("pacman")

# With the p_load() function, all packages specified are installed and loaded or just loaded if already available.
pacman::p_load(reticulate, tidyverse, lubridate, ggthemes, janitor)

# Let's specify the path the version of python you'd like to use inside the R session.
use_python("/Users/michaelespero/opt/anaconda3/bin/python")

# Now that the path to the desired version of python is specified, let's check that python is available in RStudio.
# The initialize argument gets python started if it's not already.
py_available(initialize = T)

# With python available we can check to see if some of the python modules we want to use are ready.
py_module_available(module = "numpy")

py_module_available(module = "pandas")

py_module_available(module = "sklearn")

py_module_available(module = "nltk")

# Lastly, we can check out the python configuration in RStudio with the py_config() function.
py_config()

# At this point R and Python may be ready to work together.
# We'll go over things like installing Python modules and statistics/data science workflows in R and Python.




Binary file not shown.
101,297 changes: 101,297 additions & 0 deletions 2020-01-28_reticulate/tweets.csv

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
Presentation materials from our monthly meetings

---
## 2020 ##
* 01/28/2020: *Michael Espero*, [The YAML problem: Writing and working with YAML with ymlthis](https://github.com/ocrug/presentations/tree/master/2020-01-28_reticulate)

## 2019 ##

Expand Down

0 comments on commit b8f2d74

Please sign in to comment.