Code Monkey home page Code Monkey logo

carpentries-incubator / reproducible-publications-with-rstudio Goto Github PK

View Code? Open in Web Editor NEW
12.0 4.0 20.0 80.58 MB

Introduction to Reproducible Publications with Quarto

Home Page: https://carpentries-incubator.github.io/reproducible-publications-quarto/

License: Other

Ruby 0.73% Makefile 5.41% R 7.09% Shell 0.50% Python 48.28% HTML 37.99%
lesson alpha carpentries-incubator english open-science project-management r reproducible-paper rstudio scientific-reproducibility qmd quarto

reproducible-publications-with-rstudio's Introduction

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:

  • Module 1 - Reproducibility and Project Organization: This module consists of two episodes introducing learners to reproducible research and project management fundamentals. It lays the groundwork for a robust and transparent workflow, ensuring that all participants, whether beginners or those seeking a refresher, are on the same page before delving into the specifics of Quarto and RStudio Posit.
  • Module 2 - Quarto and RStudio: This module focuses on Quarto and its features for creating dynamic and reproducible documents. We guide learners through the ins and outs of Quarto, helping them harness this authoring framework and tool potential to create visually appealing, easily reproducible, and shareable documents.
  • Module 3 - Collaboration: This module shifts the focus to collaboration and publishing. It explores effective collaboration with others, using version control within RStudio, pushing local changes to a remote repository, managing dependencies for R/Quarto projects, and sharing reproducible research with a wider audience.

This lesson has a supplementary repository with the project example used for challenges and exercises.

For an earlier version of this workshop using RMarkdown, please check for the v1.0-RMarkdown release.

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 to fix this issue.

Maintainer(s)

Current maintainers of this lesson are:

  • Renata Curty (rcurty)
  • Torin White (torwhite)
  • Ian Lessing (ilessing)
  • Greg Janee (gjanee)
  • Julien Brun (brunj7)
  • kristi Liu (kristi-sara)

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:

  • Line Breaks: must have two spaces at the end of the line or manually add a break

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

  1. Exercises (i.e. "follow me" not challenges) code:
~~~
## MATERIALS AND METHODS  
### Survey Overview  
### Data Analysis  
~~~
{: .source}

outputs as: image

  1. Challenges
  • Make sure to label challenges CHALLENGE [ep#.challenge#]
  • the solution is just SOLUTION code:
> ## CHALLENGE 3.1
> Insert headings throughout the rest of the paper so it is split into 5 sections (Introduction, Materials and Methods, Results and Discussion, Conclusion, and References). Use the search function in R Markdown to find these lines in the document. 
>
>> ## SOLUTION
>> ```
>> ## INTRODUCTION
>> ## MATERIALS AND METHODS
>> ## RESULTS AND DISCUSSION
>> ## CONCLUSION
>> ## REFERENCES
>> ```
>> Why are we using `##`? Because `#` should only be used once in the paper (for the title) and `##` is for the next heading level.
> {: .solution}
{: .challenge}

outputs as: image

  • heading should say Tip: [short description of tip]
> ## Tip: how to make callouts
> Use `>`s on each line of callout and after callout ends the next line should contain {: .callout}
{: .callout}

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

  • 2022-09-23 release version 1.0 - This version compatibile with R-studio "Ghost Orchid" Release 2021.09.02 or thereabouts.
  • Fall-Winter 2022 plan to update this workshop for compatibility with Quarto

reproducible-publications-with-rstudio's People

Contributors

actions-user avatar apandas avatar brunj7 avatar gjanee avatar ilessing avatar kristi-sara avatar rcurty avatar torwhite avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

reproducible-publications-with-rstudio's Issues

ep. 4 add relative path vs. complete path review

Instructions

Thanks for contributing! ❤️

If this contribution is for instructor training, please email the link to this contribution to
[email protected] so we can record your progress. You've completed your contribution
step for instructor checkout by submitting this contribution!

If this issue is about a specific episode within a lesson, please provide its link or filename.

Keep in mind that lesson maintainers are volunteers and it may take them some time to
respond to your contribution. Although not all contributions can be incorporated into the lesson
materials, we appreciate your time and effort to improve the curriculum. If you have any questions
about the lesson maintenance process or would like to volunteer your time as a contribution
reviewer, please contact The Carpentries Team at [email protected].

You may delete these instructions from your comment.

- The Carpentries

ep 2. tip: resources to learn rmarkdown

The tip at the end says, ‘if you want to learn how to use the source editor (as we call it) please see the following documentation. You will need to know Markdown formatting (specifically R-flavored Markdown).’ , is this referring to the rest of the workshop or should there be a link there? - AM

It does say see the following documentation but there isn't any -KL

ep. 7 Clarification on external script

‘Now, we will learn how to call code from an external script instead of copying and pasting code from a code chunk in the rmd document that resides in an r script in a different directory of our project’. I understand what you’re saying, but it reads a little confusing.

ep. 7 list numbering off

Benefits of global knitr options: 1) Set working directory so file paths (for code chunks) can be relative to the root instead of our .Rmd file Global code chunk options 3) Load libraries and data once instead of in each code chunk ← Goes from 1) to 3). Is that in reference to the list above it or was there an error in numbering?

Ep 2 - 5: Missing teaching and exercise time

Episodes 1 and 6 - 10 have teachinga and exercise time in yaml header. Still missing in episodes 2 - 5. I suppose this is due to still trying to figure out how long things will take.

ep 2. Clarification on visual editor mode

Amelia didn’t see a spot that actually says how to change into Visual Editor mode.
(though it is mentioned later in Workshop). Is it better to have it in this episode or just keep it as is?

ep. 5 Change instructions from import repository to fork on Github

confusion explained below:

"Under ‘Our Turn’ it says, ‘We are each going to make a copy of this repository to use for this workshop. To do so:’ but the picture isn’t too clear about what the user will be doing and newer Github users won’t know that the two overlapping squares mean ‘copy’.
I think it would also be good to specify that we are pasting the https:// into the repository clone URL sport and adding a personal repository name.
Then to click ‘Begin import’
I think the intention is then to copy the URL of your personal repository rather than the original
Click ‘Create Project’
"

Agreed in meeting several weeks ago that we should show forking not creating/importing repository

ep. 5 Git workflow typo

Under ‘Git Workflow’ I think there should be an s at the end of ‘file’: choose a file or files to take a “snapshot” of

ep. 3 remove challenge 2.3

It doesn't fit there since we've switched to the visual editor.

Could fit in episode 2 when discussing source editor - optional section?

ep. 4 R project / version control

"Before we use Git in RStudio project, we must have an .RProj file so let’s talk about R Projects."

clarify this statement further.

ep. 3 remove mention of code folder

Under ‘3. Rendering your Rmd document’, it mentions a ‘code’ subfolder. Did I miss the part where we created that?
Mentioned later in Workshop. Maybe don’t ask them to put anything into the ‘code’ folder until we set it up later

ep. 3 consider moving challenge 3.1

With the other challenge regarding markdown formatting moved to ep. 2, review and decide whether challenge 3.1 still makes sense where it is in ep. 3

ep. 6 add Windows shortcuts

‘Formatting Rmd Documents with the Visual Editor’ are there similar keyboard shortcuts for non-MAC users?

ep 4. finish R project section

Instructions

Thanks for contributing! ❤️

If this contribution is for instructor training, please email the link to this contribution to
[email protected] so we can record your progress. You've completed your contribution
step for instructor checkout by submitting this contribution!

If this issue is about a specific episode within a lesson, please provide its link or filename.

Keep in mind that lesson maintainers are volunteers and it may take them some time to
respond to your contribution. Although not all contributions can be incorporated into the lesson
materials, we appreciate your time and effort to improve the curriculum. If you have any questions
about the lesson maintenance process or would like to volunteer your time as a contribution
reviewer, please contact The Carpentries Team at [email protected].

You may delete these instructions from your comment.

- The Carpentries

ep. 4 add README file recommendations

Instructions

Thanks for contributing! ❤️

If this contribution is for instructor training, please email the link to this contribution to
[email protected] so we can record your progress. You've completed your contribution
step for instructor checkout by submitting this contribution!

If this issue is about a specific episode within a lesson, please provide its link or filename.

Keep in mind that lesson maintainers are volunteers and it may take them some time to
respond to your contribution. Although not all contributions can be incorporated into the lesson
materials, we appreciate your time and effort to improve the curriculum. If you have any questions
about the lesson maintenance process or would like to volunteer your time as a contribution
reviewer, please contact The Carpentries Team at [email protected].

You may delete these instructions from your comment.

- The Carpentries

ep. 4 under readme file section add license/citation information

Instructions

Thanks for contributing! ❤️

If this contribution is for instructor training, please email the link to this contribution to
[email protected] so we can record your progress. You've completed your contribution
step for instructor checkout by submitting this contribution!

If this issue is about a specific episode within a lesson, please provide its link or filename.

Keep in mind that lesson maintainers are volunteers and it may take them some time to
respond to your contribution. Although not all contributions can be incorporated into the lesson
materials, we appreciate your time and effort to improve the curriculum. If you have any questions
about the lesson maintenance process or would like to volunteer your time as a contribution
reviewer, please contact The Carpentries Team at [email protected].

You may delete these instructions from your comment.

- The Carpentries

All ep. - renumber figs

Instructions

Thanks for contributing! ❤️

If this contribution is for instructor training, please email the link to this contribution to
[email protected] so we can record your progress. You've completed your contribution
step for instructor checkout by submitting this contribution!

If this issue is about a specific episode within a lesson, please provide its link or filename.

Keep in mind that lesson maintainers are volunteers and it may take them some time to
respond to your contribution. Although not all contributions can be incorporated into the lesson
materials, we appreciate your time and effort to improve the curriculum. If you have any questions
about the lesson maintenance process or would like to volunteer your time as a contribution
reviewer, please contact The Carpentries Team at [email protected].

You may delete these instructions from your comment.

- The Carpentries

Ep.05 - Figs 1 & 2

We need to provide these two figures to learners so that they can easily browse and include them in the manuscript.

ep. 3 add load package command for rticles

Under ‘Finding and Applying Existing Templates’
This omits the command to load the articles package. 'On RStudio, load the rticles package by Once you’ve loaded the package is completed, use the plus icon at the upper-left side of your screen to create a new document or proceed with File>New File>R Markdown. This will prompt the window for creating a new R Markdown document as we saw earlier.'

ep. 7 Clarification on copy/pasting code

‘Now, let’s open our 03_HR_analysis.R script in our code folder. Copy the code and paste it in between the two lines with backticks and `{r}.’ ← Into our data paper file markdown file, right?

ep. 7 wording

“So, that basically totally defeats the purpose of automating generating our plots” Automatically?

ep. 3: the screenshot has a fixme

Under part ‘1. YAML header’ the code snapshot has a ‘#FIXME make sure this matches final paper version’. Is this fine as is or do we need to change it?
this thing

FYI: Visual editor in RStudio messes up Challenge formatting

for example, this challenge:

> ## CHALLENGE 2.2 - Installing Packages
>
> Install the following packages: `bookdown`, `tidyverse`, `knitr`, `rticles`,`kable` 
>> ## SOLUTION 
>> We can use the `install.packages()` command to install the required packages. 
>> ```
>> install.packages("bookdown")\
>> install.packages("tidyverse")
>> install.packages("knitr")
>> install.packages("rticles") 
>> install.packages("kable")
>> ```
>> An alternate solution, to install multiple packages with a single `install.packages()` command is: 
>> ```
>> install.packages(c("bookdown", "tidyverse", "knitr", "rticles", "kable")) 
>> ```
> {: .solution} 
{: .challenge}

changes to this:

> ## CHALLENGE 2.2 - Installing Packages
>
> Install the following packages: `bookdown`, `tidyverse`, `knitr`, `rticles`,`kable` \> ## SOLUTION \> We can use the `install.packages()` command to install the required packages. \> `> install.packages("bookdown")\ > install.packages("tidyverse") > install.packages("knitr") > install.packages("rticles")  > install.packages("kable") >` \> An alternate solution, to install multiple packages with a single `install.packages()` command is: \> `> install.packages(c("bookdown", "tidyverse", "knitr", "rticles", "kable"))  >` {: .solution} {: .challenge}

Then, it doesn't render correctly with jekyll

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.