install.packages('tinytex')
tinytex::install_tinytex()Software Setup
Software Requirements
This workshop assumes you have the R, RStudio and Git and Bash Shell software installed on your computer and a personal GitHub account. You will also need some geospatial system libraries installed.
R
R can be downloaded here.
RStudio
RStudio is an environment for developing using R.
It can be downloaded here. You will need the Desktop version (> 1.0) for your computer.
Geospatial Libraries
Some of the workflows require geospatial packages like sf and have additional system requirements. Follow the installation instructions in sf package documentation according to your operating system.
Git & GitHub
Required for the Version Control part of the the course
Install Git
Git is a version control system that lets you track who made changes to what when and has options for easily updating a shared or public version of your code on github.com.
To install Git, follow these instructions.
Create GitHub Account
You will need a supported web browser (current versions of Chrome, Firefox or Safari, or Internet Explorer version 9 or above).
You will also need an account at github.com. Basic GitHub accounts are free.
Research Compendium Exercise
For the final practical sessions, we will need to use LaTeX. If you don’t have LaTeX installed, consider installing TinyTeX, a custom LaTeX distribution based on TeX Live that is small in size but functions well in most cases, especially for R users.
Check docs before before installing.
devtools requirements
You might also need a set of development tools to install and run devtools. On Windows, download and install Rtools, and devtools takes care of the rest. On Mac, install the Xcode command line tools. On Linux, install the R development package, usually called r-devel or r-base-dev.
Install R dependencies
To be able to run materials locally, you will also need to install all the required R packages. Run the following code:
# Install pak if not available
if (!requireNamespace("pak", quietly = TRUE)) {
install.packages("pak")
}
# Student packages for wood-survey project (Days 2-4)
# Note: curl, openssl and stringi are listed explicitly so they get
# rebuilt against whatever Ubuntu/system libraries the current Posit
# Cloud base image provides. Without this, pre-installed binaries from
# an older image link against libraries (libssl.so.1.1, libicu66, ...)
# that no longer exist after an image upgrade and fail at load time.
dependencies <- c(
"assertr",
"broom",
"checkmate",
"credentials",
"curl",
"dataspice",
"dplyr",
"fs",
"geosphere",
"ggplot2",
"gt",
"here",
"janitor",
"jsonlite",
"listviewer",
"magrittr",
"openssl",
"purrr",
"readr",
"renv",
"skimr",
"stringi",
"tibble",
"tidyr",
"usethis"
)
pak::pak(dependencies)Package Development section
# Install pak if not available
if (!requireNamespace("pak", quietly = TRUE)) {
install.packages("pak")
}
# Student packages for mypackage project (Days 4-5)
dependencies <- c(
"cowsay",
"credentials",
"devtools",
"pkgdown",
"remotes",
"renv",
"testthat",
"usethis"
)
pak::pak(dependencies)Research Compendium with rrtools section
# Install pak if not available
if (!requireNamespace("pak", quietly = TRUE)) {
install.packages("pak")
}
# Student packages for rrcompendium project (Day 5)
dependencies <- c(
"broom",
"credentials",
"devtools",
"dplyr",
"ggplot2",
"ggthemes",
"gt",
"readr",
"renv",
"usethis",
"benmarwick/rrtools"
)
pak::pak(dependencies)
# Install tinytex for PDF rendering
pak::pak("tinytex")
tinytex::install_tinytex()