UCSBCarpentry / Reproducible-Publications-with-RStudio-Quarto

Introduction to Reproducible Publications with Quarto
https://UCSBCarpentry.github.io/Reproducible-Publications-with-RStudio-Quarto/
Other
8 stars 10 forks source link

Introduction to Reproducible Publications with Quarto

This workshop explores the powerful combination of Quarto and RStudio to author scientific publications. Our aim is to enhance researchers' adoption of open and reproducible practices while improving their project and data management skills.

This workshop is structured into three modules. The modular format encourages instructors to view the workshop as a comprehensive but flexible curriculum, allowing them to focus on specific areas of interest. Recognizing variations in proficiency levels and familiarity with RStudio among learners, we have designed this workshop to be flexible, allowing for the abbreviation or skipping of episodes to cater to specific needs:

This lesson has a supplementary repository with the project example) "FIXME: UPDATE WITH NEW LINK IN THE INCUBATOR AFTER PR IS ACCEPTED" used for challenges and exercises.

Create a Slack Account with us

Contributing

We welcome all contributions to improve the lesson! Your expertise and perspective are crucial to elevating the quality and effectiveness of the workshop content. Whether sharing domain-specific knowledge, addressing existing issues, suggesting improvements, or teaching the workshop materials, we invite you to contribute. Please refer to the issues page for topics seeking contributions, and feel free to flag any bugs, add questions, or recommend opportunities for improvement on the issues page. Maintainers will do their best to help you if you have any questions, concerns, or experience any difficulties along the way.

We'd like to ask you to familiarize yourself with our Contribution Guide and have a look at the more detailed guidelines on proper formatting, ways to render the lesson locally, and even how to write new episodes.

Please see the current list of issues for ideas for contributing to this repository. For making your contribution, we use the GitHub flow, which is nicely explained in the chapter Contributing to a Project in Pro Git by Scott Chacon. Look for the tag good_first_issue. This indicates that the maintainers will welcome a pull request fixing this issue.

Maintainer(s)

Current maintainers of this lesson are:

Authors

A list of contributors to the lesson can be found in AUTHORS

Citation

To cite this lesson, please consult with CITATION

Thanks for contributing to The Carpentries Incubator! This repository provides a blank starting point for lessons to be developed here.

A member of the Carpentries Curriculum Team will work with you to get your lesson listed on the Community Developed Lessons page and make sure you have everything you need to begin developing your new lesson.

What to do next

Before you begin developing your new lesson, here are a few things we recommend you do:

* To set the URL on GitHub, click the gear wheel button next to About on the right of the repository landing page. The lesson URL structure is https://carpentries-incubator.github.io/<repository-slug>: a repository at https://github.com/carpentries-incubator/new-lesson/ will have pages at the lesson URL https://carpentries-incubator.github.io/new-lesson/.

R Markdown vs. Github Markdown

Note the two flavors of markdown are different. Some formatting tips:

Lesson-specific formatting

For formatting & consistency's sake, we should : 1) for examples that don't need to be input to the paper example rmd file, DON'T use {: .source} callouts but DO use `` \``` so the markdown doesn't render. For short partial line chunks can be used. 2) use{: .source}` callouts for code we're walking them through to add to the rmd file. 3) for challenge solutions the solutions should be unrendered markdown syntax between ``` ``` 4) for tips, use the {: .callout} callout

Examples: 1) R markdown examples
code: image *I can't get the markdown to render correctly this this comment so this is just a screenshot

outputs to: image

2) Exercises (i.e. "follow me" not challenges) code:

~~~
## MATERIALS AND METHODS  
### Survey Overview  
### Data Analysis  
~~~
{: .source}

outputs as: image

3) Challenges

4)

Generate regular vanilla Markdown from R-markdown for episodes

When creating episodes in the _episodes_rmd directory you'll want to process them into rgular markdown so they will be further processed by Github and published when pushed to Github. If you have the make utility, which Mac or Linux has by default you can call make lesson-m. But if you do not have make which is the case for most windows users then you can use R and Knitr from the command line. There are two ways to do this for Windows users:

1) Use knitr from the command line/ Rstudio terminal to process an R-markdown file into a regular markdown file: assumes you are in the root directory change the file name to match the episode you edited

Rscript -e 'knitr::knit("./_episodes_rmd/01-r-markdown-episode-template.Rmd", output = "./_episodes/01-r-markdown-episode-template.md")'

2) Change your knit button settings Next to the knit button there is a gear for options. Click it and chose output options at the very bottom of the list. Choose the Advanced tab and check keep markdown source file. Requires that you move some files around after: Make sure to 1) move the .md file to the _episodes/ folder and 2) delete the html file output.

*method 1 will work even if all your image links etc. aren't working. Method 2 won't work unless all links are correct - errors out otherwise.

Code for all lessons method 1 cheatsheet:

# episode 2:
Rscript -e 'knitr::knit("./_episodes_rmd/02-basic-rstudio.Rmd", output = "./_episodes/02-basic-rstudio.md")'
# episode 3:
Rscript -e 'knitr::knit("./_episodes_rmd/03-rmarkdown-file.Rmd", output = "./_episodes/03-rmarkdown-file.md")'
# episode 4:
Rscript -e 'knitr::knit("./_episodes_rmd/04-good-project.Rmd", output = "./_episodes/04-good-project.md")'
# episode 5:
Rscript -e 'knitr::knit("./_episodes_rmd/05-setup-versioning.Rmd", output = "./_episodes/05-setup-versioning.md")'
# episode 6:
Rscript -e 'knitr::knit("./_episodes_rmd/07-code-chunks.Rmd", output = "./_episodes/07-code-chunks.md")'

Releases and Roadmap