Code Monkey home page Code Monkey logo

repub's Introduction

Reproducible Publishing using Quarto

Publication Docker image workflow

Motivation

Loads of tutorials and literature about reproducible research is available but it turned out that there was no repository (that I know of) that reproducibly maps everything from the beginning (data analysis) to the end (publication). This repo is supposed to offer exactly that: It should be directly usable without customization, but also provide help to be able to adapt it to your own needs at necessary points.

Exemplary workflow

Repdoducible Analysis including Docker

Exemplary workflow to ensure reproducibility in data analysis and manuscript writing. The code for pre-processing, the analysis and the presentation of the results in the manuscript (code) are version-controlled. The build information of the container for the runtime and development environment (Dockerfile + docker-compose) is also version-controlled. The container image is version-controlled as well and stored in a dedicated online repository. The raw data itself is not version controlled via Git.

RStudio with Quarto documents

Repdoducible Analysis in RStudio using Quarto

RStudio as integrated development environment for writing and compiling quarto documents with code (e.g. R or Python) and text (using Markdown or the visual editor). On the left: RStudio interface for composing the text and code next to each other. On the right: Rendered output document with dynamically incorporated results.

Data process to the final manuscript in Quarto

The text and code are evaluated on the basis of the data provided, resulting in a dynamically generated manuscript in the form of a Word, PDF or HTML document.

Further readings

Interested in more information? Find the full paper about this project here.

Preparations

  1. Make sure, you have Docker installed
  2. Make sure, you have Git installed

How to use

  1. Clone this repository:

    git clone https://github.com/joundso/repub.git
    cd repub
  2. Start the containerized RStudio by running start.sh, or by running:

    cd docker
    docker-compose up -d
  3. Open RStudio in your browser at http://127.0.0.1:8080/

    1. Login with the username rstudio and password pwd
    2. Open the project repub.Rproj in the lower right corner of the file browser
  4. Build the manuscript in the upper right part of RStudio: Build tab --> Render Book button

  5. See the result in the included viewer or the file in the docs folder

Questions?

Details

Literature

For the integration of the sources from the references.bib file in the continuous text, permanent citation keys are used. To dynamically create a references.bib file, the Zotero plugin Better BibTeX for Zotero can be used.

  1. Installation instructions: https://retorque.re/zotero-better-bibtex/installation/

  2. Afterwards, the 'automatic export' function can be used to automatically create and update a *.bib file depending on the content in your Zotero instance.

  3. One example for the creation of citation keys might be this: auth.lower.replace(find=".",replace=_)+len+year | veryshorttitle+shortyear. Information about the citation keys are available here.

  4. If necessary, adapt the path to the .bib file in _quarto.yml:

    ## The literature file goes here (use e.g. 
    ## 'Better BibTeX for Zotero' to dynamically create this file):
    bibliography: meta/references.bib

Citation styles

There are thousnds of citation styles available for free online: https://github.com/citation-style-language/styles Download the necessary style, store it locally and add the path to the .csl file to the _quarto.yml:

## Citation styltes from here: https://github.com/citation-style-language/styles
csl: meta/ios-press-books.csl

Outlook

  • Next to RStudio for R: Add Jupyter with Python backend to Docker deployment

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.