Convert rmarkdown (.Rmd) files into jupyter notebooks (.ipynb).
Create a .Rmd file.
rmd<-"# Module 1. Working with web APIs## Gathering publicly available web dataThe two most common ways to collect publicly available web data are (1) web scraping and (2) interacting with Application Program Interfaces (API).## Web scraping- A normal workflow goes something like this - Extract website source code, known as Extensible Markup Language (XML). XML is similar to HTML only designed for storing not displaying data. - Although XML trees contain elements, tags, and text, data collected via web scraping is almost always unstructred### Web scraping in R- I recommend the {rvest} package.\`\`\`{r}library(rvest)## population statisticspopulation_url <-\"https://en.wikipedia.org/wiki/List_of_countries_by_population_(United_Nations)\"## read in pagepop <- read_html(population_url)\`\`\`"## save as temp filetmp<- tempfile(fileext=".Rmd")cat(rmd,file=tmp)## render htmlrmarkdown::render(tmp)## output outputbrowseURL(gsub("\\.Rmd$",".html",tmp))
Screen capture of output.

Now convert to an ipython notebook.
## install and load rmd2jupyterdevtools::install_github("mkearney/rmd2jupyter")library(rmd2jupyter)## convertrmd2jupyter(tmp)## open via your jupyter notebook method
Screen capture of jupyter notebook.
