Skip to content

Commit 16d29d5

Browse files
committed
binder badge technique
1 parent 6716270 commit 16d29d5

File tree

6 files changed

+132
-45
lines changed

6 files changed

+132
-45
lines changed

docs/index.html

Lines changed: 74 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2040,7 +2040,7 @@ <h3>${suggestion.title}</h3>
20402040
</script>
20412041

20422042
<!--/radix_placeholder_distill-->
2043-
<script src="site_libs/header-attrs-2.11/header-attrs.js"></script>
2043+
<script src="site_libs/header-attrs-2.13/header-attrs.js"></script>
20442044
<script src="site_libs/popper-2.6.0/popper.min.js"></script>
20452045
<link href="site_libs/tippy-6.2.7/tippy.css" rel="stylesheet" />
20462046
<link href="site_libs/tippy-6.2.7/tippy-light-border.css" rel="stylesheet" />
@@ -2101,19 +2101,28 @@ <h3>${suggestion.title}</h3>
21012101
<h1>Git, GitHub &amp; RStudio</h1>
21022102
<!--radix_placeholder_categories-->
21032103
<!--/radix_placeholder_categories-->
2104-
<p>RStudio users can leverage git Version control to enhance reproducibility.</p>
2104+
<p>RStudio users can leverage git Version control to enhance
2105+
reproducibility.</p>
21052106
</div>
21062107

21072108

21082109
<div class="d-article">
2109-
<p>The <a href="https://usethis.r-lib.org/"><code>usethis</code></a> package and the RStudio IDE will help you orchestrate your version control repositories as RStudio projects.</p>
2110+
<p>The <a href="https://usethis.r-lib.org/"><code>usethis</code></a>
2111+
package and the RStudio IDE will help you orchestrate your version
2112+
control repositories as RStudio projects.</p>
21102113
<iframe width="560" height="315" src="https://www.youtube.com/embed/r5_v5f6128M" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
21112114
</iframe>
21122115
<!-- <iframe width="560" height="315" src="https://warpwire.duke.edu/w/t0oFAA/" frameborder="0" scrolling="0" allow="autoplay; encrypted-media; fullscreen; picture-in-picture;" allowfullscreen></iframe> -->
21132116
<iframe width="560" height="315" src="https://www.youtube.com/embed/Cn-72tbRNFc" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
21142117
</iframe>
21152118
<h3 id="setup">Setup</h3>
2116-
<p>To get started, make a free GitHub.com account. Make sure you have the latest versions of R, RStudio, and usethis. Then, setup your RStudio configuration using two key documents: <a href="https://usethis.r-lib.org/articles/articles/usethis-setup.html">Setup</a>, and <a href="https://usethis.r-lib.org/articles/articles/git-credentials.html">Managing Git(Hub) Credentials</a>.</p>
2119+
<p>To get started, make a free GitHub.com account. Make sure you have
2120+
the latest versions of R, RStudio, and usethis. Then, setup your RStudio
2121+
configuration using two key documents: <a
2122+
href="https://usethis.r-lib.org/articles/articles/usethis-setup.html">Setup</a>,
2123+
and <a
2124+
href="https://usethis.r-lib.org/articles/articles/git-credentials.html">Managing
2125+
Git(Hub) Credentials</a>.</p>
21172126
<h3 id="tips">Tips</h3>
21182127
<h4 id="clone-or-fork-from-github">Clone or fork from GitHub</h4>
21192128
<div class="layout-chunk" data-layout="l-body">
@@ -2122,7 +2131,8 @@ <h4 id="clone-or-fork-from-github">Clone or fork from GitHub</h4>
21222131
</code></pre>
21232132
</div>
21242133
</div>
2125-
<h4 id="create-the-github-repo-from-local">Create the GitHub repo from local</h4>
2134+
<h4 id="create-the-github-repo-from-local">Create the GitHub repo from
2135+
local</h4>
21262136
<div class="layout-chunk" data-layout="l-body">
21272137
<div class="sourceCode">
21282138
<pre class="sourceCode r"><code class="sourceCode r"><span class='kw'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='op'>(</span><span class='va'><a href='https://usethis.r-lib.org'>usethis</a></span><span class='op'>)</span>
@@ -2145,7 +2155,8 @@ <h4 id="rename-default-branch">Rename default branch</h4>
21452155
</code></pre>
21462156
</div>
21472157
</div>
2148-
<h4 id="set-up-git-and-manage-github-credentials">set-up git and manage GitHub credentials</h4>
2158+
<h4 id="set-up-git-and-manage-github-credentials">set-up git and manage
2159+
GitHub credentials</h4>
21492160
<div class="layout-chunk" data-layout="l-body">
21502161
<div class="sourceCode">
21512162
<pre class="sourceCode r"><code class="sourceCode r"><span class='co'># Sign-in to your GitHub account</span>
@@ -2161,8 +2172,14 @@ <h4 id="set-up-git-and-manage-github-credentials">set-up git and manage GitHub c
21612172
</div>
21622173
</div>
21632174
<h3 id="next-level">Next Level…</h3>
2164-
<p>Take your reproducibility to the next level. <a href="https://guides.github.com/activities/citable-code/">Make your code citable</a> by connecting your GitHub repo and your <a href="https://orcid.org/register">ORCID</a> (unique author ID) through to the <a href="https://zenodo.org/">Zenodo</a> archival repository. Now, every time you commit a milestone release, you also mint a DOI.</p>
2165-
<h4 id="share-a-zero-install-compute-environment">Share a zero-install compute environment</h4>
2175+
<p>Take your reproducibility to the next level. <a
2176+
href="https://guides.github.com/activities/citable-code/">Make your code
2177+
citable</a> by connecting your GitHub repo and your <a
2178+
href="https://orcid.org/register">ORCID</a> (unique author ID) through
2179+
to the <a href="https://zenodo.org/">Zenodo</a> archival repository.
2180+
Now, every time you commit a milestone release, you also mint a DOI.</p>
2181+
<h4 id="share-a-zero-install-compute-environment">Share a zero-install
2182+
compute environment</h4>
21662183
<!-- Containerize your repository with binder.org using the [`holepunch` package](https://karthik.github.io/holepunch/) -->
21672184
<p>Publish your code in a binder.org container</p>
21682185
<!-- Use the [`holepunch` package](https://karthik.github.io/holepunch/) -->
@@ -2171,32 +2188,69 @@ <h4 id="share-a-zero-install-compute-environment">Share a zero-install compute e
21712188
</div>
21722189
<!-- #### Bespoke_Publish your code in a binder -->
21732190
<!-- I recently found my QuickPublish approach _didn't quite work_. So I RTFMed the binder.org docs and it seemed to imply a preference for NOT using a `.binder/Dockerfile`. Therefore, here is an approach that is slightly less automated but more bulletproof. -->
2174-
<p>Everything you need is exemplified in binder-example for R that you can <a href="https://github.com/binder-examples/r">find on github</a></p>
2175-
<p>The key elements are an <code>install.R</code> and <code>runtime.txt</code> files. The content and format of each file is demonstrated properly at the GitHub repo. Browse and you will see.</p>
2191+
<p>Everything you need is exemplified in binder-example for R that you
2192+
can <a href="https://github.com/binder-examples/r">find on
2193+
github</a></p>
2194+
<p>The key elements are an <code>install.R</code> and
2195+
<code>runtime.txt</code> files. The content and format of each file is
2196+
demonstrated properly at the GitHub repo. Browse and you will see.</p>
21762197
<p><strong>Step 1</strong></p>
21772198
<div class="layout-chunk" data-layout="l-body">
21782199

21792200
</div>
21802201
<ol type="a">
2181-
<li>Create an <code>install.R</code> file and store it in the RStudio Project’s root directory.<br> Follow the example at <a href="https://github.com/binder-examples/r" class="uri">https://github.com/binder-examples/r</a> <br></li>
2202+
<li>Create an <code>install.R</code> file and store it in the RStudio
2203+
Project’s root directory.<br> Follow the example at <a
2204+
href="https://github.com/binder-examples/r"
2205+
class="uri">https://github.com/binder-examples/r</a> <br></li>
21822206
</ol>
21832207
<blockquote>
2184-
<p>This file should consist of install functions for each package used in your R code. If you’re not sure what packages you’re using, try running <code>holepunch::write_compendium_description()</code> and you will find the details listed in the DESCRIPTION file under the ‘Depends’ and ‘Remotes’ sections. <strong>IMPORTANT</strong>: Delete the <code>DESCRIPTION</code> file Before launching the binder build. In my experience the DESCRIPTION file will conflict with the binder’s build process. <br> For non-CRAN packages – specifically packages installed from GitHub – I recommend using the format: <code>remotes::install_github("gadenbuie/countdown")</code> for each package that is not on CRAN. CRAN packages can follow the format: <code>install.packages("dplyr")</code></p>
2208+
<p>This file should consist of install functions for each package used
2209+
in your R code. If you’re not sure what packages you’re using, try
2210+
running <code>holepunch::write_compendium_description()</code> and you
2211+
will find the details listed in the DESCRIPTION file under the ‘Depends’
2212+
and ‘Remotes’ sections. <strong>IMPORTANT</strong>: Delete the
2213+
<code>DESCRIPTION</code> file Before launching the binder build. In my
2214+
experience the DESCRIPTION file will conflict with the binder’s build
2215+
process. <br> For non-CRAN packages – specifically packages installed
2216+
from GitHub – I recommend using the format:
2217+
<code>remotes::install_github("gadenbuie/countdown")</code> for each
2218+
package that is not on CRAN. CRAN packages can follow the format:
2219+
<code>install.packages("dplyr")</code></p>
21852220
</blockquote>
21862221
<ol start="2" type="a">
2187-
<li>Create a <code>runtime.txt</code> file and store it in the RStudio Project’s root directory<br> Follow the example at <a href="https://github.com/binder-examples/r" class="uri">https://github.com/binder-examples/r</a> <br></li>
2222+
<li>Create a <code>runtime.txt</code> file and store it in the RStudio
2223+
Project’s root directory<br> Follow the example at <a
2224+
href="https://github.com/binder-examples/r"
2225+
class="uri">https://github.com/binder-examples/r</a> <br></li>
21882226
</ol>
21892227
<blockquote>
2190-
<p>Note: If you try using <code>holepunch</code>, it will store these files in a <code>.binder</code> subdirectory. In my experience this will cause the binder build to fail. For this reason, I don’t recommend using holepunch and I do recommend storing the two files in the Project root directory.</p>
2228+
<p>Note: If you try using <code>holepunch</code>, it will store these
2229+
files in a <code>.binder</code> subdirectory. In my experience this will
2230+
cause the binder build to fail. For this reason, I don’t recommend using
2231+
holepunch and I do recommend storing the two files in the project’s root
2232+
directory.</p>
21912233
</blockquote>
21922234
<p><strong>Step 2</strong></p>
2193-
<p>Generate a binder badge with <code>holepunch::generate_badge()</code>. This should store the badge in your GitHub’s project <code>README.md</code> file. Then <code>commit</code> and <code>push</code> your changes to GitHub; go to the README on GitHub, launch the build and wait for the long launch/build time.</p>
2235+
<p>Generate a binder badge with
2236+
<code>usethis::use_binder_badge(urlpath = "rstudio")</code>. This should
2237+
store the badge in your GitHub’s project <code>README</code> file. Then
2238+
<code>commit</code> and <code>push</code> your changes to GitHub; go to
2239+
the README on GitHub, launch the build and wait for the long
2240+
launch/build time.</p>
2241+
<p>Hint: be prepared to wait. The first build can take some time.
2242+
Sometimes you must launch an initial or dormant build more than once. In
2243+
my experienced these hiccups are rare, but try the launch twice before
2244+
getting involved in extensive troubleshooting.</p>
21942245
<!-- a. Edit the `.binder/install.R` file using the following [model](https://github.com/binder-examples/r/blob/master/install.R). -->
21952246
<!-- b. Edit the `binder/install.R` file based on this [model](https://github.com/binder-examples/r/blob/master/runtime.txt) or the [documentation](https://github.com/jupyterhub/repo2docker/pull/772#issue-313426641) -->
21962247
<!-- b. Edit the `DESCRIPTION` file using this basic [model](https://github.com/libjohn/workshop_twitter_analysis/blob/main/DESCRIPTION). **Modify all the fields**. You may want to base the `Depends` and `Remotes` sections on your `.binder/install.R` file -->
21972248
<hr />
2198-
<p><em>The old documentation from this site can be found in the <a href="https://github.com/data-and-visualization/git-tutorial/releases/tag/v0.9.2019">v.0.2019 release</a> on GitHub</em>.</p>
2199-
<div class="sourceCode" id="cb1"><pre class="sourceCode r distill-force-highlighting-css"><code class="sourceCode r"></code></pre></div>
2249+
<p><em>The old documentation from this site can be found in the <a
2250+
href="https://github.com/data-and-visualization/git-tutorial/releases/tag/v0.9.2019">v.0.2019
2251+
release</a> on GitHub</em>.</p>
2252+
<div class="sourceCode" id="cb1"><pre
2253+
class="sourceCode r distill-force-highlighting-css"><code class="sourceCode r"></code></pre></div>
22002254
<!--radix_placeholder_article_footer-->
22012255
<!--/radix_placeholder_article_footer-->
22022256
</div>
@@ -2218,7 +2272,9 @@ <h3 id="reuse">Reuse</h3>
22182272
<!--radix_placeholder_navigation_after_body-->
22192273
<div class="distill-site-nav distill-site-footer">
22202274
<p><a href="https://rfun.library.duke.edu/">R We Having Fun Yet‽</a></p>
2221-
<p><a href="https://library.duke.edu/data/">Center for Data &amp; Visualization Sciences</a>. <a href="https://library.duke.edu/">Duke University Libraries</a></p>
2275+
<p><a href="https://library.duke.edu/data/">Center for Data &amp;
2276+
Visualization Sciences</a>. <a href="https://library.duke.edu/">Duke
2277+
University Libraries</a></p>
22222278
</div>
22232279
<!--/radix_placeholder_navigation_after_body-->
22242280

docs/resources.html

Lines changed: 49 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2037,7 +2037,7 @@ <h3>${suggestion.title}</h3>
20372037
</script>
20382038

20392039
<!--/radix_placeholder_distill-->
2040-
<script src="site_libs/header-attrs-2.11/header-attrs.js"></script>
2040+
<script src="site_libs/header-attrs-2.13/header-attrs.js"></script>
20412041
<script src="site_libs/popper-2.6.0/popper.min.js"></script>
20422042
<link href="site_libs/tippy-6.2.7/tippy.css" rel="stylesheet" />
20432043
<link href="site_libs/tippy-6.2.7/tippy-light-border.css" rel="stylesheet" />
@@ -2105,46 +2105,73 @@ <h1>Resources</h1>
21052105
<div class="d-article">
21062106
<h2 id="slides">Slides</h2>
21072107
<ul>
2108-
<li><a href="https://docs.google.com/presentation/d/1FJlC01xATiOfPmUxURHtMI6IUY1Sr7aMIQ0J4F2YJHU/edit?usp=sharing">Research Reproducibility, 2021</a></li>
2108+
<li><a
2109+
href="https://docs.google.com/presentation/d/1FJlC01xATiOfPmUxURHtMI6IUY1Sr7aMIQ0J4F2YJHU/edit?usp=sharing">Research
2110+
Reproducibility, 2021</a></li>
21092111
</ul>
21102112
<h2 id="social-coding-sites">Social Coding Sites</h2>
21112113
<ul>
2112-
<li><p><a href="https://github.com" class="uri">https://github.com</a></p></li>
2113-
<li><p><a href="https://gitlab.com" class="uri">https://gitlab.com</a></p></li>
2114-
<li><p><a href="https://bitbucket.org" class="uri">https://bitbucket.org</a></p></li>
2115-
<li><p>Duke’s <a href="https://gitlab.oit.duke.edu/">GitLab</a> Instance</p>
2114+
<li><p><a href="https://github.com"
2115+
class="uri">https://github.com</a></p></li>
2116+
<li><p><a href="https://gitlab.com"
2117+
class="uri">https://gitlab.com</a></p></li>
2118+
<li><p><a href="https://bitbucket.org"
2119+
class="uri">https://bitbucket.org</a></p></li>
2120+
<li><p>Duke’s <a href="https://gitlab.oit.duke.edu/">GitLab</a>
2121+
Instance</p>
21162122
<ul>
2117-
<li><a href="https://gitlab.oit.duke.edu/help/ssh/README">Managing SSH keys</a></li>
2123+
<li><a href="https://gitlab.oit.duke.edu/help/ssh/README">Managing SSH
2124+
keys</a></li>
21182125
</ul></li>
21192126
</ul>
21202127
<h2 id="gui-git-clients">GUI Git Clients</h2>
21212128
<ul>
2122-
<li><a href="https://rstudio.com">RStudio</a> – Free. Great for useRs</li>
2123-
<li><a href="https://www.sublimemerge.com/">Sublime’s Merge</a> – Downloaded and evaluated for free. $100 / 3-years of upgrades.<br />
2129+
<li><a href="https://rstudio.com">RStudio</a> – Free. Great for
2130+
useRs</li>
2131+
<li><a href="https://www.sublimemerge.com/">Sublime’s Merge</a>
2132+
Downloaded and evaluated for free. $100 / 3-years of upgrades.<br />
21242133
</li>
2125-
<li>GitKracken – <strong>Free</strong> if you have the <a href="https://education.github.com/pack">GitHub Student</a> Pack or the <a href="https://www.gitkraken.com/github-teacher-toolbox">GitHub Teacher toolbox</a></li>
2126-
<li><a href="https://www.sourcetreeapp.com/">SourceTree</a> – Free. (defaults to use with <a href="https://bitbucket.org/">BitBucket</a>)</li>
2134+
<li>GitKracken – <strong>Free</strong> if you have the <a
2135+
href="https://education.github.com/pack">GitHub Student</a> Pack or the
2136+
<a href="https://www.gitkraken.com/github-teacher-toolbox">GitHub
2137+
Teacher toolbox</a></li>
2138+
<li><a href="https://www.sourcetreeapp.com/">SourceTree</a> – Free.
2139+
(defaults to use with <a
2140+
href="https://bitbucket.org/">BitBucket</a>)</li>
21272141
</ul>
21282142
<h3 id="packages">Packages</h3>
21292143
<ul>
2130-
<li><a href="https://usethis.r-lib.org/" class="uri">https://usethis.r-lib.org/</a></li>
2131-
<li><a href="https://karthik.github.io/holepunch/"><code>holepunch</code></a> to make your reproducible code a container on binder.org</li>
2144+
<li><a href="https://usethis.r-lib.org/"
2145+
class="uri">https://usethis.r-lib.org/</a></li>
2146+
<li><a
2147+
href="https://karthik.github.io/holepunch/"><code>holepunch</code></a>
2148+
to make your reproducible code a container on binder.org</li>
21322149
</ul>
21332150
<h3 id="free-book">Free Book</h3>
21342151
<ul>
2135-
<li><a href="http://happygitwithr.com/">Happy Git and GitHub for the useR</a></li>
2152+
<li><a href="http://happygitwithr.com/">Happy Git and GitHub for the
2153+
useR</a></li>
21362154
</ul>
21372155
<h3 id="handy-article">Handy Article</h3>
21382156
<ul>
2139-
<li><a href="https://www.codementor.io/citizen428/git-tutorial-10-common-git-problems-and-how-to-fix-them-aajv0katd">10 Common Problems / Solutions</a></li>
2157+
<li><a
2158+
href="https://www.codementor.io/citizen428/git-tutorial-10-common-git-problems-and-how-to-fix-them-aajv0katd">10
2159+
Common Problems / Solutions</a></li>
21402160
</ul>
21412161
<h2 id="reproducibility">Reproducibility</h2>
21422162
<ul>
2143-
<li><a href="http://kbroman.org/Tools4RR/assets/lectures/07_clearcode.pdf">Writing clear code: Tools for Reproducible Research</a></li>
2144-
<li><a href="http://kbroman.org/steps2rr/">Initial Steps Toward Reproducible Research</a></li>
2145-
<li>Making your research reproducible with TIER + R + GitHub <a href="#slides">Slides</a>. Cetinkaya-Rundel, M. (2016). Open Science Framework. Retrieved from <a href="https://osf.io/phyau" class="uri">https://osf.io/phyau</a></li>
2163+
<li><a
2164+
href="http://kbroman.org/Tools4RR/assets/lectures/07_clearcode.pdf">Writing
2165+
clear code: Tools for Reproducible Research</a></li>
2166+
<li><a href="http://kbroman.org/steps2rr/">Initial Steps Toward
2167+
Reproducible Research</a></li>
2168+
<li>Making your research reproducible with TIER + R + GitHub <a
2169+
href="#slides">Slides</a>. Cetinkaya-Rundel, M. (2016). Open Science
2170+
Framework. Retrieved from <a href="https://osf.io/phyau"
2171+
class="uri">https://osf.io/phyau</a></li>
21462172
</ul>
2147-
<div class="sourceCode" id="cb1"><pre class="sourceCode r distill-force-highlighting-css"><code class="sourceCode r"></code></pre></div>
2173+
<div class="sourceCode" id="cb1"><pre
2174+
class="sourceCode r distill-force-highlighting-css"><code class="sourceCode r"></code></pre></div>
21482175
<!--radix_placeholder_article_footer-->
21492176
<!--/radix_placeholder_article_footer-->
21502177
</div>
@@ -2166,7 +2193,9 @@ <h3 id="reuse">Reuse</h3>
21662193
<!--radix_placeholder_navigation_after_body-->
21672194
<div class="distill-site-nav distill-site-footer">
21682195
<p><a href="https://rfun.library.duke.edu/">R We Having Fun Yet‽</a></p>
2169-
<p><a href="https://library.duke.edu/data/">Center for Data &amp; Visualization Sciences</a>. <a href="https://library.duke.edu/">Duke University Libraries</a></p>
2196+
<p><a href="https://library.duke.edu/data/">Center for Data &amp;
2197+
Visualization Sciences</a>. <a href="https://library.duke.edu/">Duke
2198+
University Libraries</a></p>
21702199
</div>
21712200
<!--/radix_placeholder_navigation_after_body-->
21722201

0 commit comments

Comments
 (0)