{"id":14977342,"url":"https://github.com/mkearney/rmd2jupyter","last_synced_at":"2025-10-28T03:31:15.780Z","repository":{"id":39706871,"uuid":"116708289","full_name":"mkearney/rmd2jupyter","owner":"mkearney","description":"Convert Rmd (rmarkdown) to ipynb (Jupyter notebook)","archived":false,"fork":false,"pushed_at":"2018-01-08T23:17:16.000Z","size":171,"stargazers_count":24,"open_issues_count":1,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T10:51:12.506Z","etag":null,"topics":["ipynb-notebook","jupyter-notebook","python","python-notebook","r","rmarkdown","rmd","rstats"],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkearney.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-08T17:42:08.000Z","updated_at":"2024-12-30T10:23:33.000Z","dependencies_parsed_at":"2022-08-24T01:31:02.350Z","dependency_job_id":null,"html_url":"https://github.com/mkearney/rmd2jupyter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkearney%2Frmd2jupyter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkearney%2Frmd2jupyter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkearney%2Frmd2jupyter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkearney%2Frmd2jupyter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkearney","download_url":"https://codeload.github.com/mkearney/rmd2jupyter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238590593,"owners_count":19497351,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ipynb-notebook","jupyter-notebook","python","python-notebook","r","rmarkdown","rmd","rstats"],"created_at":"2024-09-24T13:55:29.000Z","updated_at":"2025-10-28T03:31:10.728Z","avatar_url":"https://github.com/mkearney.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE, eval = FALSE)\n```\n\n## rmd2jupyter\n\nConvert rmarkdown (.Rmd) files into jupyter notebooks (.ipynb).\n\n### Example\n\nCreate a .Rmd file.\n\n```{r rmd}\nrmd \u003c- \"# Module 1. Working with web APIs\n\n## Gathering publicly available web data\n\nThe two most common ways to collect publicly available web data are (1) web scraping and (2) interacting with Application Program Interfaces (API).\n\n## Web scraping\n\n- A normal workflow goes something like this\n    - Extract website source code, known as Extensible Markup Language (XML). XML is similar to HTML only designed for storing not displaying data.\n    - Although XML trees contain elements, tags, and text, data collected via web scraping is almost always unstructred\n\n### Web scraping in R\n- I recommend the {rvest} package.\n\n\\`\\`\\`{r}\nlibrary(rvest)\n\n## population statistics\npopulation_url \u003c- \\\"https://en.wikipedia.org/wiki/List_of_countries_by_population_(United_Nations)\\\"\n\n## read in page\npop \u003c- read_html(population_url)\n\\`\\`\\`\"\n\n## save as temp file\ntmp \u003c- tempfile(fileext = \".Rmd\")\ncat(rmd, file = tmp)\n\n## render html\nrmarkdown::render(tmp)\n\n## output output\nbrowseURL(gsub(\"\\\\.Rmd$\", \".html\", tmp))\n```\n\n#### Rmd -\u003e html\n\nScreen capture of output.\n\n![](tools/readme/ss_rmd.png)\n\n#### Rmd -\u003e ipynb.\n\nNow convert to an ipython notebook.\n\n```{r}\n## install and load rmd2jupyter\ndevtools::install_github(\"mkearney/rmd2jupyter\")\nlibrary(rmd2jupyter)\n\n## convert\nrmd2jupyter(tmp)\n\n## open via your jupyter notebook method\n```\n\nScreen capture of jupyter notebook.\n\n![](tools/readme/ss_ipynb.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkearney%2Frmd2jupyter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkearney%2Frmd2jupyter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkearney%2Frmd2jupyter/lists"}