Skip to content

Commit

Permalink
Built site for gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Quarto GHA Workflow Runner committed Sep 29, 2023
1 parent 6ecd494 commit 5cf9711
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .nojekyll
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c58dc0bd
b5ac3189
42 changes: 30 additions & 12 deletions 3-3-automate.html
Original file line number Diff line number Diff line change
Expand Up @@ -355,21 +355,39 @@ <h1 class="title"><span class="chapter-number">10</span>&nbsp; <span class="chap
<section id="make-for-automation" class="level3">
<h3 class="anchored" data-anchor-id="make-for-automation">Make for automation</h3>
<p>There are many automation tools out there that researchers use for their research pipelines. The probably oldest among them is called <em>Make</em>. It is not only old, but still very functional, useful, and versatile.</p>
<p>Here is an example <code>Makefile</code>, that could be used by an R user:</p>
<p>Let’s say we work on a project and have the following folders and files:</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode makefile code-with-copy"><code class="sourceCode makefile"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="dv">data_clean/PlantGrowth_new.csv:</span><span class="dt"> data_raw/PlantGrowth.csv preprocess.R</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a> Rscript preprocess.R</span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="dv">boxplot_weight-group.pdf:</span><span class="dt"> data_clean/PlantGrowth_new.csv overview.R</span></span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a> Rscript overview.R</span>
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a><span class="dv">all:</span><span class="dt"> boxplot_weight-group.pdf</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>make-example
├── Makefile
├── PlantGrowth_new.csv
├── boxplot_weight-group.pdf
├── data_clean
│&nbsp;&nbsp; └── PlantGrowth_new.csv
├── data_raw
│&nbsp;&nbsp; └── PlantGrowth.csv
├── overview.R
└── preprocess.R

2 directories, 7 files</code></pre>
</div>
<p>TODO explain and visualize</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode makefile code-with-copy"><code class="sourceCode makefile"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="dv">target:</span><span class="dt"> dependency1 dependency2</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a> code to create target from dependencies</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<p>Here is an example <code>Makefile</code>, that could be used by an R user:</p>
<div class="code-with-filename">
<div class="code-with-filename-file">
<pre><strong>Makefile</strong></pre>
</div>
<div class="sourceCode" id="cb2"><pre class="sourceCode makefile code-with-copy"><code class="sourceCode makefile"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="dv">data_clean/PlantGrowth_new.csv:</span><span class="dt"> data_raw/PlantGrowth.csv preprocess.R</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a> Rscript preprocess.R</span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a><span class="dv">boxplot_weight-group.pdf:</span><span class="dt"> data_clean/PlantGrowth_new.csv overview.R</span></span>
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a> Rscript overview.R</span>
<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-7"><a href="#cb2-7" aria-hidden="true" tabindex="-1"></a><span class="dv">all:</span><span class="dt"> boxplot_weight-group.pdf</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<p>TODO explain and visualize</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode makefile code-with-copy"><code class="sourceCode makefile"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="dv">target:</span><span class="dt"> dependency1 dependency2</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a> code to create target from dependencies</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>


</section>
Expand Down
2 changes: 1 addition & 1 deletion search.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"href": "3-3-automate.html",
"title": "10  Automate your code",
"section": "",
"text": "Research projects that deal with data and code can be imagined as a pipeline. Data comes in at certain points and then they are processed in several steps. We do some data cleaning, an overview of the data, create figures, do some modelling with the data (simulation, statistics, machine learning, etc.) and in the end we write some text (usually a paper).\n\n\n\n\nResearch pipeline\n\n\n\nOf course, this is a simplified view of what really happens. Most research projects are quite complex and it is really hard to keep track of everything. What data should be used for which analysis? What code should be used for what?\n\n\n\n\nResearch pipeline (more realistic)\n\n\n\nGood organisation and version control help us tremendously to keep track of all the complexity. But what if the pipes of our pipeline would stick together nicely and we would not have to execute everything manually? What if we could automate stuff? Well, we can!\n\nMake for automation\nThere are many automation tools out there that researchers use for their research pipelines. The probably oldest among them is called Make. It is not only old, but still very functional, useful, and versatile.\nHere is an example Makefile, that could be used by an R user:\n\ndata_clean/PlantGrowth_new.csv: data_raw/PlantGrowth.csv preprocess.R\n Rscript preprocess.R\n\nboxplot_weight-group.pdf: data_clean/PlantGrowth_new.csv overview.R\n Rscript overview.R\n\nall: boxplot_weight-group.pdf\n\nTODO explain and visualize\n\ntarget: dependency1 dependency2\n code to create target from dependencies"
"text": "Research projects that deal with data and code can be imagined as a pipeline. Data comes in at certain points and then they are processed in several steps. We do some data cleaning, an overview of the data, create figures, do some modelling with the data (simulation, statistics, machine learning, etc.) and in the end we write some text (usually a paper).\n\n\n\n\nResearch pipeline\n\n\n\nOf course, this is a simplified view of what really happens. Most research projects are quite complex and it is really hard to keep track of everything. What data should be used for which analysis? What code should be used for what?\n\n\n\n\nResearch pipeline (more realistic)\n\n\n\nGood organisation and version control help us tremendously to keep track of all the complexity. But what if the pipes of our pipeline would stick together nicely and we would not have to execute everything manually? What if we could automate stuff? Well, we can!\n\nMake for automation\nThere are many automation tools out there that researchers use for their research pipelines. The probably oldest among them is called Make. It is not only old, but still very functional, useful, and versatile.\nLet’s say we work on a project and have the following folders and files:\n\n\nmake-example\n├── Makefile\n├── PlantGrowth_new.csv\n├── boxplot_weight-group.pdf\n├── data_clean\n│   └── PlantGrowth_new.csv\n├── data_raw\n│   └── PlantGrowth.csv\n├── overview.R\n└── preprocess.R\n\n2 directories, 7 files\n\n\nHere is an example Makefile, that could be used by an R user:\n\n\nMakefile\n\ndata_clean/PlantGrowth_new.csv: data_raw/PlantGrowth.csv preprocess.R\n Rscript preprocess.R\n\nboxplot_weight-group.pdf: data_clean/PlantGrowth_new.csv overview.R\n Rscript overview.R\n\nall: boxplot_weight-group.pdf\n\nTODO explain and visualize\ntarget: dependency1 dependency2\n code to create target from dependencies"
},
{
"objectID": "4-publishing-research.html",
Expand Down

0 comments on commit 5cf9711

Please sign in to comment.