Create Rmarkdown webpage on gitHub
Rmarkdown
GitHub
RStudio
Webpage
Abstract
Short description how to create an Rmarkdown webpage and publish it on gitHub
- Create a new R Project:
File -> New Project -> New Directory -> Simple Rmarkdown website - Open new project
- Activate “git” versioning for this project (
tools -> project Options -> Git/SVN) - Edit the YAML file
_site.yml:
add the line: `output_dir: “docs”`` - Build website:
Build -> Build all - Change to Github Desktop
- Add repository:
File -> Add local repository - Click: Publish repository
- Open Github in Webbrowser and login
- Go to the new published repository
- Click
Settings - Go to menu
Pagesor scroll to Github Pages - At the field “Source” select
master - Change
select folderfrom\(root)to\docs - click save
- Copy / remember / open the link to the new webpage that opens up! 16 Change to webpage project at RStudio
- Commit and publish all files
[tab] Git -> Commit - Change to the new webpage address you remembered/copied or opened! (probably wait 30 seconds and renew the page)
That’s it!