November 5, 2024
Special thanks to Nick Bearman for sharing an earlier version of these slides!
quarto can be used to create documents, web pages, in an effort to increase replicability and reproducibility“[…] when the same analysis steps performed on the same dataset […] produce the same answer.” (Turing Way)
We need to have confidence that our research is good quality and we are doing good science
Peter Fisher (1993) compared seven different pieces of GIS software doing a viewshed analysis
and got seven (slightly) different results!
Fisher also discovered a major error in one piece of software which gave completely incorrect results.
Highlights the need for:
Fisher, P. F. (1993). Algorithm and implementation uncertainty in viewshed analysis. International Journal of Geographical Information Systems, 7(4), 331–347. https://doi.org/10.1080/02693799308901965
Standards & testing to make sure this doesn’t happen
Algorithms used to be published so people can see what is happening
Issues when only binary files are available, and not the source code
Some journals & conferences ask you to submit code along with your paper
AGILE - https://reproducible-agile.github.io/
Anyone (with a similar level of skills) should be able to do reproduce your research and benefit from it.
One reason for open source tools.
If you do analysis in ArcGIS Pro, you need ArcGIS Pro to recreate that analysis.
If you don’t have ArcGIS Pro, what do you do?
Documenting what you did is standard - Methods
If you can do what you did in a script, then you can also share this
ArcGIS Pro / QGIS
R / Python
To replicate a piece of work, you need to know what software they used
What version?
Which libraries / packages?
What version of libraries or packages?
Also works for writing and presentations as well.
Markdown allows you to write plain text with tags - stars, hashes, etc.
Can also do analysis in this
LaTeX is a developed version of Markdown (or Markdown is a simple version of LaTeX)
RMarkdown allows you to run R code
Quarto allows you to run other code (Python, R, etc.)
This presentation is written in Quarto 😄
taken from What is Quarto - A Quick Intro FAQ
```{r}
#| label: "iris-plot"
#| echo: TRUE
#| fig-format: svg
#| cache: TRUEs
data(iris)
plot(iris$Sepal.Length, iris$Sepal.Width,
main = "Scatter Plot of Sepal Length vs Sepal Width",
xlab = "Sepal Length (cm)",
ylab = "Sepal Width (cm)",
pch = 16, col = iris$Species)
```defaults to knitr engine (you can override the engine with engine: jupyter)
```{python}
#| label: fig-polar
#| fig-cap: "A line plot on a polar axis"
import numpy as np
import matplotlib.pyplot as plt
r = np.arange(0, 2, 0.01)
theta = 2 * np.pi * r
fig, ax = plt.subplots(
subplot_kw = {'projection': 'polar'}
)
ax.plot(theta, r)
ax.set_rticks([0.5, 1, 1.5, 2])
ax.grid(True)
plt.show()
```Figure 1 further explores the impact of temperature on ozone level.
Figure 1: Temperature and ozone level.
Strengths 💪
Weaknesses 😢
By setting up your teaching materials in a reproducible manner, you demonstrate the value of reproducibility directly