title | date | subtitle | reading | presentation | tasks | ||||
---|---|---|---|---|---|---|---|---|---|
Reproducible Research and R Markdown |
2018-10-10 |
|
|
View Presentation [Open presentation in a new tab](presentations/day_13_repro.html){target='_blank'}
<iframe class='embed-responsive-item' src='presentations/day_13_repro.html' allowfullscreen></iframe>
_Click on presentation and then use the space bar to advance to the next slide
or escape key to show an overview._
R Script |
Commented R Script |
Rmd Script |
---|
Cheatsheet:
https://www.rstudio.com/wp-content/uploads/2015/02/rmarkdown-cheatsheet.pdf
Today we will make a copy of a template for your final project, edit it, and 'push' it back up to your github account. You can check out the template code at https://github.com/AdamWilsonLab/RDataScience_Project and the template website at http://adamwilson.us/RDataScience_Project/
Steps:
- Go to https://github.com/AdamWilsonLab/RDataScience_Project
- Log into Github using your account (or create a new account)
- Click
fork
near the upper right corner. This will create a copy in your GitHub Account. See here for more details - After it completes, click the green button "Clone or Download" and copy the URL.
- File -> New Project -> Version Control -> Git
- URL: paste from above. It will be similar to
https://github.com/AdamWilsonLab/RDataScience_Project.git
but with your username. - Project name: you can rename it if you want or keep the default:
RDataScience_Project
- Project as subdirectory of
~/Documents/repos
or wherever you want to put it.
- It should download the project to your computer then open it to the
index.Rmd
file.
- Select the
Build
tab in the upper right corner of RStudio, then clickBuild Website
- Check out the website settings in
_site.yml
. These adjust the appearance, title, etc. - Check out
_navbar.yml
. These settings define the menus, etc. If you only have one page you probably won't need to adjust this information.
- Select the
Git
tab in the upper right and notice how it keeps track of any changes.
- To 'commit' the files (which is like saving them), check the files you want to commit (or all of them) and click
commit
. - Type in a brief message about the changes you made. Maybe something like "First update to my project materials"
- Click
Commit
, thenclose
. - Click
Push
to push it back up to GitHub.
- Now go to your repository website (similar to https://github.com/AdamWilsonLab/RDataScience_Project in your account)
- Click settings in the upper right, then scroll down to
GitHub Pages
section- Source:
master branch /docs folder
- Source:
- Go to your new project webpage (URL will be similar to http://adamwilson.us/RDataScience_Project/)
- Now you can
commit
and thenpush
your updates and your website will be updated. If you get tired of entering your username and password every time, check out the instructions here.
- Use the Cheatsheet to add sections and some example narrative.
- Try changing changing the species name to your favorite species and re-run the report.
- Add more figures or different versions of a figure
- Check out the
kable()
function for tables (e.g.kable(head(d))
)
Abandoning the habit of secrecy in favor of process transparency and peer review was the crucial step by which alchemy became chemistry.Raymond, E. S., 2004, The art of UNIX programming: Addison-Wesley.