Skip to content

Commit 809869e

Browse files
authored
Merge pull request #1 from rcurty/main
Reviewed by UCSB Team
2 parents fe44317 + 74ae6e8 commit 809869e

17 files changed

Lines changed: 63 additions & 58 deletions

05-github.PNG

-579 KB
Binary file not shown.

episodes/01-introduction.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ start: yes
1717
:::::::::::::::::::::::::::::::::::::::: questions
1818

1919
- What is reproducible research?
20-
- How can RStudio help research to be more reproducible?
20+
- How can RStudio help research be more reproducible?
2121
- What are the benefits of using RStudio for writing academic essays and papers?
2222

2323
::::::::::::::::::::::::::::::::::::::::::::::::::
@@ -44,7 +44,7 @@ Reproducible studies allow other researchers to perform the same processes and a
4444
- The researchers can't find some of the data they used to generate the original results and can't figure out which parameters they used when running their analyses.
4545
- The manuscript is still languishing in the drawer…
4646

47-
According to the [U.S. National Science Foundation (NSF)](https://www.nsf.gov/sbe/AC_Materials/SBE_Robust_and_Reliable_Research_Report.pdf) subcommittee on replicability in science (2015):
47+
According to the [U.S. National Science Foundation (NSF)](https://rcra.emory.edu/_includes/documents/sections/oric/8-social-behavioral-and-economic-sciences-perspectives-on-robust-and-reliable-science.pdf) subcommittee on replicability in science (2015):
4848

4949
Science should routinely evaluate the reproducibility of findings that enjoy a prominent role in the published literature. To make reproduction possible, efficient, and informative, researchers should sufficiently document the details of the procedures used to collect data, convert observations into analyzable data, and perform data analysis.
5050

@@ -93,16 +93,16 @@ Let's assume I have convinced you that reproducibility and transparency are in y
9393

9494
From day one and throughout the whole research life cycle! Before starting the project, you might have to learn tools like R or Git. If you wait too long while doing the analysis, you might lose a lot of time trying to remember what you did two months ago. When you write the paper, you want up-to-date numbers, tables, and figures. When you co-author a paper, you want to make sure that the analyses presented in a paper with your name on it are sound. When you review a paper, you can't judge the results if you don't know how the authors got there.
9595

96-
[Alexander (2022)](https://tellingstorieswithdata.com/) suggests three steps towards better reproducibility:
96+
[Alexander (2023)](https://rohanalexander.github.io/telling_stories-published) argues that reproducibility often starts out as a burden—something others require of you, and it can feel tedious or frustrating. But that perception usually changes the moment you return to a project after some time away. Then, it becomes clear that reproducibility isn’t just essential for advancing data science—it’s also a practical tool that makes your own work easier to understand and build upon later. To achieve reproducibility, the author suggests a three-step approach:
9797

9898
1) Ensure the entire workflow is documented. This may involve addressing questions such as:
9999

100100
- How was the raw dataset obtained, and is access likely to be persistent and available to others?
101-
- What specific steps are being taken to transform the raw data in the data that were analyzed, and how can this be made available to others?
101+
- What specific steps are being taken to transform the raw data into the data that was analyzed, and how can this be made available to others?
102102
- What analysis has been done, which codes/scripts were used, and how can this be shared clearly?
103103
- How has the final paper or report been built, and to what extent can others follow that process themselves?
104104

105-
2) Try to accomplish progressively the following requirements:
105+
2) Try to progressively accomplish the following requirements:
106106

107107
- Can you run your entire workflow again?
108108
- Can another person run your entire workflow again?
@@ -139,7 +139,7 @@ RStudio has a handy "Environment" window, which shows all of the objects you hav
139139

140140
### Makes it easy to set your working directory and access files on your computer
141141

142-
With RStudio, you can navigate to folders on your computer in the "Files" window, view any files you have in that folder, or go to your working directory. You can create projects that help you set your working directory and work with relative paths"to external" files (such as input data and figures) so it can also be used on other machines.
142+
With RStudio, you can navigate to folders on your computer in the "Files" window, view any files you have in that folder, or go to your working directory. You can create projects that help you set your working directory and work with relative paths to external files (such as input data and figures), so it can also be used on other machines.
143143

144144
### Integrates with collaboration and publishing tools
145145

@@ -162,7 +162,7 @@ Developers picked a name that had meaning in the history of publishing and lande
162162

163163
## Why Quarto and not R Markdown?
164164

165-
As noted before, Quarto is the next generation of R Markdown, which was the subject of a previous workshop [see Reproducible Publications with RStudio](https://github.com/carpentries-incubator/Reproducible-Publications-with-RStudio) and the anatomy of `.rmd` and `.qmd` files are very similar. So why move to Quarto? While compatible with Python (and bash, Julia, C, SQL), R Markdown was designed primarily for R users. **Quarto does not require R.** Quarto runs computations into separate pluggable language "engine," which helps make this cross-language functionality easier to support and reduces infrastructure intensity with built-in applications. In addition, because Quarto is designed to be compatible with existing formats, you can render most existing `.Rmd` and Jupyter Notebooks with Quarto without modification. This low-pain process helps the transition to Quarto.
165+
As noted before, Quarto is the next generation of R Markdown, and the anatomy of `.rmd` and `.qmd` files is very similar. So why move to Quarto? While compatible with Python (and bash, Julia, C, SQL), R Markdown was designed primarily for R users. **Quarto does not require R.** It supports multiple languages by delegating code execution to external engines, such as Jupyter for Python and Julia, or knitr for R. This design helps support cross-language workflows and reduces infrastructure dependencies. In addition, because Quarto is designed to be compatible with existing formats, you can render most existing `.Rmd` and Jupyter Notebooks in Quarto without modification. This helps ease the transition to Quarto.
166166

167167

168168
::::::::::::::::::::::::::::::::::::::::::::::::::
@@ -175,7 +175,7 @@ Nitsch, F. J., Sellitto, M., \& Kalenscher, T. (2021). Trier social stress test
175175

176176
We will also be using a simplified version of the project directory containing data files and scripts published by the authors on Open Science Framework: <https://doi.org/10.17605/OSF.IO/6MVQ7>.
177177

178-
The adapted paper template and project directory are used exclusively for instruction purposes with permission from the authors.
178+
The adapted paper template and project directory are used exclusively for instructional purposes with permission from the authors.
179179

180180
:::::::::::::::::::::::::::::::::::::::: keypoints
181181

episodes/01-repro-project-org/02-reproducibility.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ The three principles of file naming are:
166166
- i.e. `CC-101_1_data.csv`
167167
- i.e. `CC-101_2_data.csv`
168168

169-
Adapted from [https://datacarpentry.org/rr-organization1/01-file-naming/index.html](https://datacarpentry.org/rr-organization1/01-file-naming/index.html). For more tips on file naming, check: [The Dos and Don'ts of File Naming](https://www.library.ucsb.edu/sites/default/files/dls-n01-2021-filenaming.pdf).
169+
Adapted from [https://datacarpentry.org/rr-organization1/01-file-naming/index.html](https://datacarpentry.org/rr-organization1/01-file-naming/index.html). For more tips on file naming, check: [The Dos and Don'ts of File Naming](https://perma.cc/9YGZ-D3J5).
170170

171171
> ## Challenge 2: File name syntax
172172
>
@@ -238,7 +238,7 @@ Anything generated by your scripts should be treated as disposable: it should al
238238
There are lots of different ways to manage this output. Having an output folder with different sub-directories for each separate analysis makes it easier later. Since many analyses are exploratory and aren’t used in the final project, some of the analyses get shared between projects.
239239

240240
#### **Include a README file**
241-
For more information about the README file and a customizable template, check this [handout](https://www.library.ucsb.edu/sites/default/files/dls-n03-2021-readme-navy.pdf). Make sure to include citation and license information both for your data [see creative commons license]([https://creativecommons.org/licenses/) and software ([see license types on Github](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository)). This information will be critical for others to reuse and correctly attribute your work. You may also consider adding a separate citation and license file to your project folder.
241+
For more information about the README file and a customizable template, check this [handout](https://perma.cc/A5PN-YF7Z). Make sure to include citation and license information both for your data [see creative commons license]([https://creativecommons.org/) and software ([see license types on Github](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository)). This information will be critical for others to reuse and correctly attribute your work. You may also consider adding a separate citation and license file to your project folder.
242242

243243
Again, there are no hard and fast rules here, but remember, keeping your raw data files separate is important to ensure they don’t get overwritten after you use a script to clean your data. It’s also very helpful to keep the different files generated by your analysis organized in a folder.
244244

episodes/02-quarto/01-basic-rstudio.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ This lesson assumes you already have a basic understanding of R and RStudio but
3232
we will do a brief tour of the IDE, review R projects, and the best practices for
3333
organizing your work, and how to install or check packages you need to follow along.
3434

35-
Now, let's open RStudio. You may access it through the Jupyter Hub instance [https://carpentryworkshop.lsit.ucsb.edu](https://carpentryworkshop.lsit.ucsb.edu). After passing authentication, choose `RStudio`. If you want to follow along using your local RStudio, make sure you use IDE version RStudio v2023.06 or later and that it is running [Quarto version 1.4 or above](https://quarto.org/docs/download/prerelease.html). If you need to check that, for RStudio, choose `Help` and `About RStudio`. For the Quarto version checking, type in `packageVersion("quarto")` on the console. 
35+
Now, let's open RStudio. After passing authentication, choose `RStudio`. If you want to follow along using your local RStudio, make sure you use IDE version RStudio v2023.06 or later and that it is running [Quarto version 1.4 or above](https://quarto.org/docs/download/release.html). If you need to check that, for RStudio, choose `Help` and `About RStudio`. For the Quarto version checking, type in `packageVersion("quarto")` on the console.
3636

3737

3838
**Basic layout**
@@ -73,7 +73,7 @@ Click an empty box to load that package and click a checked box to detach that
7373
package.
7474

7575
Packages can be installed and updated from the Package tab with the *Install* and
76-
*Update* buttons at the top of the tab. We have asked you to install a few packages prior to the workshop following the [setup instructions](https://github.com/UCSBCarpentry/Reproducible-Publications-with-RStudio/blob/main/setup.md) using the `install.packages()` command. Let's now make sure you have all of them good to go.
76+
*Update* buttons at the top of the tab. We have asked you to install a few packages prior to the workshop following the setup instructions using the `install.packages()` command. Let's now make sure you have all of them good to go.
7777

7878
> ## CHALLENGE 1 - Checking for Installed Packages
7979
> Which command would you use to check for packages ready for use?

episodes/02-reproducibility.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ The three principles of file naming are:
187187
- i.e. `CC-101_1_data.csv`
188188
- i.e. `CC-101_2_data.csv`
189189

190-
Adapted from <https://datacarpentry.org/rr-organization1/01-file-naming/index.html>. For more tips on file naming, check: [The Dos and Don'ts of File Naming](https://www.library.ucsb.edu/sites/default/files/dls-n01-2021-filenaming.pdf).
190+
Adapted from <https://datacarpentry.org/rr-organization1/01-file-naming/index.html>. For more tips on file naming, check: [The Dos and Don'ts of File Naming](https://perma.cc/9YGZ-D3J5).
191191

192192
::::::::::::::::::::::::::::::::::::::: challenge
193193

@@ -253,10 +253,11 @@ What would be the relative path needed to refer to the file `bronars_simulation_
253253

254254
::::::::::::::::::::::::::::::::::::::::::::::::::
255255

256-
> ## Tip: Level up your relative paths
257-
>
258-
> We just discussed how relative paths are a better practice when coding because we can guarantee our code will work on somebody else's system. However, relative paths can still be quite confusing to deal with, especially when you have many sub-directories in your project. One way to make things a bit easier on ourselves is to make sure the part that's *relative* to what we're referencing is always the same.
259-
> This is where using the `RStudio Project` can help. When you create a Project in RStudio, in the background, RStudio will automatically create a "root" folder and set it as your working directory in R. Since in R relative paths are relative to your working directory, this will ease referring to external input or output files (data, images, plots, ...) in a consistent manner across your project by always having your relative paths relative to the top level folder and help to encapsulate your work within this folder. So with an Rproject setup, the relative path in the previous example will now be:
256+
##### **Level up your relative paths**
257+
258+
We’ve just discussed how using relative paths is a better practice in coding, as it helps ensure that our code works consistently across different systems. However, relative paths can still be quite confusing to deal with, especially when you have many sub-directories in your project. One way to make things a bit easier on ourselves is to make sure the part that's *relative* to what we're referencing is always the same.
259+
260+
This is where using the `RStudio Project` can help. When you create a Project in RStudio, in the background, RStudio will automatically create a "root" folder and set it as your working directory in R. Since in R relative paths are relative to your working directory, this will ease referring to external input or output files (data, images, plots, ...) in a consistent manner across your project by always having your relative paths relative to the top level folder and help to encapsulate your work within this folder. So with an Rproject setup, the relative path in the previous example will now be:
260261

261262
```
262263
df <- read.csv("data/foodchoice_budgetlines.csv")
@@ -275,7 +276,7 @@ There are lots of different ways to manage this output. Having an output folder
275276

276277
#### **Include a README file**
277278

278-
For more information about the README file and a customizable template, check this [handout](https://www.library.ucsb.edu/sites/default/files/dls-n03-2021-readme-navy.pdf). Make sure to include citation and license information both for your data [see creative commons license]([https://creativecommons.org/licenses) and software ([see license types on Github](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository)). This information will be critical for others to reuse and correctly attribute your work. You may also consider adding a separate citation and license file to your project folder.
279+
For more information about the README file and a customizable template, check this [handout](https://perma.cc/A5PN-YF7Z). Make sure to include citation and license information both for your data [see creative commons license](https://creativecommons.org/share-your-work/cclicenses/) and software ([see license types on Github](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository)). This information will be critical for others to reuse and correctly attribute your work. You may also consider adding a separate citation and license file to your project folder.
279280

280281
Again, there are no hard and fast rules here, but remember, keeping your raw data files separate is important to ensure they don't get overwritten after you use a script to clean your data. It's also very helpful to keep the different files generated by your analysis organized in a folder.
281282

episodes/03-basic-rstudio.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ This lesson assumes you already have a basic understanding of R and RStudio but
3535
we will do a brief tour of the IDE, review R projects, and the best practices for
3636
organizing your work, and how to install or check packages you need to follow along.
3737

38-
Now, let's open RStudio. You may access it through the Jupyter Hub instance <https://carpentryworkshop.lsit.ucsb.edu>. After passing authentication, choose `RStudio`. If you want to follow along using your local RStudio, make sure you use IDE version RStudio v2023.06 or later and that it is running [Quarto version 1.4 or above](https://quarto.org/docs/download/prerelease.html). If you need to check that, for RStudio, choose `Help` and `About RStudio`. For the Quarto version checking, type in `packageVersion("quarto")` on the console. 
38+
Now, let's open RStudio. After passing authentication, choose `RStudio`. If you want to follow along using your local RStudio, make sure you use IDE version RStudio v2023.06 or later and that it is running [Quarto version 1.4 or above](https://quarto.org/docs/download/release.html). If you need to check that, for RStudio, choose `Help` and `About RStudio`. For the Quarto version checking, type in `packageVersion("quarto")` on the console.
3939

4040
**Basic layout**
4141

@@ -74,7 +74,7 @@ Click an empty box to load that package and click a checked box to detach that
7474
package.
7575

7676
Packages can be installed and updated from the Package tab with the *Install* and
77-
*Update* buttons at the top of the tab. We have asked you to install a few packages prior to the workshop following the [setup instructions](https://github.com/UCSBCarpentry/Reproducible-Publications-with-RStudio/blob/main/setup.md) using the `install.packages()` command. Let's now make sure you have all of them good to go.
77+
*Update* buttons at the top of the tab. We have asked you to install a few packages prior to the workshop following the setup instructions using the `install.packages()` command. Let's now make sure you have all of them good to go.
7878

7979
::::::::::::::::::::::::::::::::::::::: challenge
8080

episodes/03-collaboration/04-publishing-your-project.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Quarto offers some journal formats and made them available within the quarto-jou
121121

122122
This list is expected to grow rapidly with new contributions submitted to the [Quarto Journal Templates Repository](https://github.com/quarto-journals). You may also create your own templates following [these guidelines](https://quarto.org/docs/journals/templates.html).
123123

124-
Journal templates require features of Quarto version 1.2, so we must ensure we have the right version. You can check your Quarto version in the Terminal with the command: `quarto --version`. We should be good with that for this workshop, but if you are using a lab computer later on, you may need to update Quarto. See: [pre-release versions of Quarto](https://quarto.org/docs/download/prerelease.html)
124+
Journal templates require features of Quarto version 1.2 or later, so we must ensure we have the right version. You can check your Quarto version in the Terminal with the command: `quarto --version`. We should be good with that for this workshop, but if you are using a lab computer later on, you may need to update Quarto. See: [release versions of Quarto](https://quarto.org/docs/download/release.html)
125125

126126
Quarto uses a template command that can be called in the terminal to create an article in any of these formats. Suppose you want to use the Elsevier template. In Rstudio, in the terminal (if not showing, select `Tools > Terminal > New`), type `quarto use template quarto-journals/elsevier`. Then, follow the steps below:
127127

0 commit comments

Comments
 (0)