class: title-slide # trackdown ### Collaborative writing through literate programming in R <br/> #### @TASK4-2021 - 19/05/2021 .pull-left[ #### Filippo Gambarota<sup>1</sup> #### Claudio Zandonella Callegher<sup>1</sup> #### Janosch Linkersdörfer<sup>2</sup> ] .pull-right[ #### Mathew Ling<sup>3</sup> #### Emily Kothe<sup>3</sup> ] .footnote[ [1] University of Padova [2] University of California [3] Deakin University ] --- class: inverse, center, middle # A normal academic day... --- # Writing .pull-left[ <iframe src="https://giphy.com/embed/LGWYfM9Dd7Kuc" width="480" height="270" frameBorder="0" class="giphy-embed" allowFullScreen></iframe> ] -- .pull-right[ * Writing bibliography <br/> * Copy and paste statistics and results 😱 <br/> * Tables and figures 😱 <br/> * Collaboration ] --- # What about collaboration and file versions? <img src="img/phd_writing_meme.jpeg" width="35%" style="display: block; margin: auto;" /> --- class: section-slide, center, middle # Is there a solution? 😱 --- class: inverse, center, middle # YES! <br/> Literate programming 😍 --- -- .pull-left[ ## Code ```r # Plotting plot(data) # Computing mean mean(data$response) # Statistics t.test(response ~ condition) ``` ] -- .pull-right[ ## Text <img src="img/lorem_ipsum.png" style="display: block; margin: auto;" /> ] -- These components are usually separated... --- # Literate programming... Is a combination of **text** and **code** in order to produce high-quality, reproducible and scalable documents. .pull-left[ <img src="img/latex.svg" width="30%" style="display: block; margin: auto;" /> <img src="img/markdown.svg" width="30%" style="display: block; margin: auto;" /> <img src="img/r_logo.svg" width="30%" style="display: block; margin: auto;" /> ] .pull-right[ <img src="img/knitr.svg" width="50%" style="display: block; margin: auto;" /> ] --- # An example... <iframe src="files/awesome_document.txt" width="100%" height="400px" data-external="1" style="border: none;"></iframe> --- # An example... <iframe src="files/example_rmd.html" width="100%" height="400px" data-external="1" style="border: none;"></iframe> --- class: inverse, center, middle # This is great! But what about collaboration? --- # Literate programming as asynchronus process... <img src="img/google_doc_1.png" style="border: none;" style="display: block; margin: auto;" /> --- # Literate programming as asynchronus process... <img src="img/literate_programming.svg" style="display: block; margin: auto;" /> --- class: inverse, center, middle # Collaboration on plain text files --- The gold standard way to collaborate on plain text files is using a **version control** system: .pull-left[ <img src="img/git.svg" width="50%" style="display: block; margin: auto;" /> <img src="img/git_flow.svg" style="display: block; margin: auto;" /> ] .pull-right[ * .green[**Avoid multiple file version tracking a history**] <br/> * .green[**Professional way to manage projects with multiple people**] <br/> * .red[**Not intuitive and very different from a standard workflow**] ] --- # GIT is powerful but tracking narrative is hard .pull-left[ **Word-like approach** <img src="img/google_doc_1.png" style="border: none;" style="display: block; margin: auto;" /> ] .pull-right[ **GIT Diff** <img src="img/git_text_problem.png" style="display: block; margin: auto;" /> ] --- class: inverse, center, middle # In an ideal world... --- # In an ideal world... * Work using a **literate programming** framework * **Collaborate on plain text files** similarly as we usually do with Word or Google Docs <br/> <br/> ## This is the aim of the **trackdown** package --- class: inverse, center, middle # The big picture... --- # The big picture... <img src="img/trackdown_big_picture.svg" style="display: block; margin: auto;" /> --- class: inverse, center, middle # The trackdown package --- # The trackdown package <img src="img/trackdown_package.svg" width="80%" style="display: block; margin: auto;" /> --- class: inverse, center, middle # A suggested workflow --- # A suggested workflow <img src="img/workflow.svg" style="display: block; margin: auto;" /> --- class: inverse, center, middle # How a trackdown file looks like? --- # How a trackdown file looks like? -- .pull-left[ <iframe src="files/awesome_document.txt" width="100%" height="400px" data-external="1" style="border: none;"></iframe> ] -- .pull-right[ <iframe src="https://docs.google.com/document/d/1wGUY0SlDbt9zJZodJtTsjd338Aats8n_4nP1F8gCAac/edit" width="100%" height="400px" data-external="1" style="border: none;"></iframe> ] --- # Also the final output * With the `upload_file()` function is possible to also upload the output document as `.pdf` or `.html` .pull-left[ <img src="img/trackdown_example.png" style="display: block; margin: auto;" /> ] .pull-right[ <img src="img/pdf_example.png" width="70%" style="display: block; margin: auto;" /> ] --- class: inverse, center, middle # Other advantages of the plain-text + Google Docs approach --- # Other advantages of the plain-text + Google Docs approach -- * Collaboration with .red[**colleagues with a heterogeneous background**] while keeping all advantages of a **knitr** based document -- <br/> * .red[**Spell checking**] using standard tools available online (not completely possible in RStudio) <br/> -- * All amazing .red[**collaboration tools available in Google Docs**] (comments, assignments, history, auto-saving, etc.) --- # Check our repo on Github... [**ClaudioZandonella/trackdown**](https://github.com/ClaudioZandonella/trackdown) <svg viewBox="0 0 496 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg"> <path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg> <iframe src="https://github.com/ClaudioZandonella/trackdown" width="100%" height="400px" data-external="1" style="border: none;"></iframe> --- class: split-five # The developers 😎 .column[ <div class="figure" style="text-align: center"> <img src="img/filippo.jpg" alt="<a href='mailto:filippo.gambarota@phd.unipd.it'>Filippo Gambarota</a>" width="70%" /> <p class="caption"><a href='mailto:filippo.gambarota@phd.unipd.it'>Filippo Gambarota</a></p> </div> ] .column[ <div class="figure" style="text-align: center"> <img src="img/claudio.jpeg" alt="<a href='mailto:claudiozandonella@gmail.it'>Claudio Zandonella <br/> Callegher</a>" width="70%" /> <p class="caption"><a href='mailto:claudiozandonella@gmail.it'>Claudio Zandonella <br/> Callegher</a></p> </div> ] .column[ <div class="figure" style="text-align: center"> <img src="img/janosch.jpg" alt="<a href='mailto:jlinkersdoerfer@ucsd.edu'>Janosch Linkersdörfer</a>" width="70%" /> <p class="caption"><a href='mailto:jlinkersdoerfer@ucsd.edu'>Janosch Linkersdörfer</a></p> </div> ] .column[ <div class="figure" style="text-align: center"> <img src="img/mathew.jpg" alt="<a href='mailto:m.ling@deakin.edu.au'>Mathew Ling</a>" width="70%" /> <p class="caption"><a href='mailto:m.ling@deakin.edu.au'>Mathew Ling</a></p> </div> ] .column[ <div class="figure" style="text-align: center"> <img src="img/emily.jpeg" alt="<a href='mailto:emily.kothe@deakin.edu.au'>Emily Kothe</a>" width="70%" /> <p class="caption"><a href='mailto:emily.kothe@deakin.edu.au'>Emily Kothe</a></p> </div> ] --- class: psicostat # A special thanks to Psicostat members... Check our [**website**](https://psicostat.dpss.psy.unipd.it/index.html) 😄 <iframe src="https://psicostat.dpss.psy.unipd.it/index.html" width="100%" height="400px" data-external="1" style="border: none;"></iframe> --- class: final-slide, center, middle <br/> <br/> ### .large[[filippo.gambarota@phd.unipd.it](mailto:filippo.gambarota@phd.unipd.it)] <br/> <br/> .tiny[Slides made with the [Xaringan](https://github.com/yihui/xaringan) package by [Yihui Xie](https://yihui.name/)] <img src="img/final_logo.svg" width="20%" style="display: block; margin: auto;" />