-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path04-publishing.html
More file actions
101 lines (99 loc) · 3.64 KB
/
04-publishing.html
File metadata and controls
101 lines (99 loc) · 3.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE html>
<html>
<head>
<title>Author Carpentry</title>
<link rel="stylesheet" href="css/site.css">
</head>
<body>
<header>
<a href="http://authorcarpentry.github.io"><img src="img/AClogo.jpg" alt="Author Carpentry logo"></a>
</header>
<nav>
<ul>
<li>
<a href=".">Lesson</a>
</li>
<li>
<a href="00-getting-started.html">Getting Started</a>
</li>
<li>
<a href="01-markdown.html">Intro to Markdown</a>
</li>
<li>
<a href="02-modifying-appearance.html">Document Appearance</a>
</li>
<li>
<a href="03-dynamic.html">Dynamic Documents</a>
</li>
<li>
<a href="04-publishing.html">Publishing</a>
</li>
<li>
<a href="mailto:authorcarpentry@library.caltech.edu">Contact Us</a>
</li>
</ul>
</nav>
<section>
<h1 id="publishing-your-reproducible-report">
Publishing Your Reproducible Report
</h1>
<p>
1.5 hours
</p>
<hr />
<h2 id="learning-objectives">
Learning Objectives
</h2>
<ul>
<li>
Publish your document and code via GitHub and, if time, RStudio
</li>
</ul>
<h3 id="github">
GitHub
</h3>
<p>
In your GitHub account, create a new repository (the name doesn’t matter) and make sure to check the box for Initialize this repo with a README file. Open Finder of Windows explorer on your computer. Navigate to the data directory and find the .html file you’ve been knitting. Rename this file to <code>index.html</code>.
</p>
<p>
On GitHub, click on ‘Upload a file’. Drag index.html to the box and click the green button at the bottom. Now go to settings on GitHub. Scroll down to the GHPages section and click the dropbown to select masster. Click Save. If you now scroll down to the GHPages section you’ll see a github.io url. Copy this and go back to the code section of your GitHub Repository. Click and add the url. If you click on this link you’ll see your report!
</p>
<h3 id="rpubs">
Rpubs
</h3>
<p>
Open your document in Rstudio. Click Knit. You’ll see a publish button in the item view pane - click it. You’ll be redirected to the rpubs web site. If you don’t have an account you’ll need to register. You’ll see a screen with basic metadata, but all is optional. Your document is published online!
</p>
<h3 id="binder">
Binder
</h3>
<p>
We need to copy all files used by knitter into our GitHub repository. Make a copy of your .Rmd file that doesn’t include the ORCID section (The authentication is a pain). Then we need to tell Binder that we want to run R and what our dependencies are. In GitHub, create a <code>runtime.txt</code> file that contains: <code>r-2018-07-09</code>. This chooses a version of R at the date indicated. Next create a <code>install.R</code> file that contains:
</p>
<pre><code>install.packages("rmarkdown")
install.packages("bitops")
install.packages("caTools")
install.packages("tidyverse")
install.packages("DT")</code></pre>
<p>
Now edit the README file in Github and add:
</p>
<pre><code>https://mybinder.org/v2/gh/AuthorCarpentry/R-Binder/master?urlpath=rstudio</code></pre>
<p>
replacing <code>AuthorCarpentry</code> with your GitHub account name and <code>R-Binder</code> with your GitHub repository name. Click the Binder button and your environment will load (it might take up to 20 mins the first time).
</p>
<h2 id="wrapup">
Wrapup
</h2>
</section>
<footer>
<span>© Author Carpentry</span>
<span><a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img
alt="Creative Commons License" style="vertical-align: middle;"
src="https://i.creativecommons.org/l/by/4.0/80x15.png" /></a></span>
<span>This work is licensed under a <a rel="license"
href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution
4.0 International License</a></span>
</footer>
</body>
</html>