Getting started#
Learning environment#
Use the course’s tested R environment rather than installing packages inside a notebook. RStudio is useful for developing functions; Jupyter with the R kernel presents narrative, computation, and output together. Open notebooks from their containing directory and run them top to bottom after restarting the kernel.
From the repository root, follow the README’s environment setup. scripts/setup_r.R installs missing dependencies explicitly; renv.lock records tested R package versions. Python build dependencies are recorded in requirements-build.lock.txt. A lock records software; it does not certify an analysis or reproduce a changing remote service.
To work interactively, use a Jupyter front end installed in the same environment and select the R kernel. Do not assume a generic hosted Python notebook automatically supports R. Local fresh-kernel execution is the reference workflow.
First successful run#
Open the Quantitative epistemology investigation.
Restart the R kernel and run all cells in order.
Check that the data contain unique trial identifiers and finite reaction times.
Read the final
sessionInfo()output and record the code revision.Change one prespecified simulation condition and explain what changed.
The notebooks load book/R/course.R, whose short functions implement the shared simulation, splits, metrics, and scaling. A row in the lexical simulation is a participant–item trial. rt is in milliseconds, correct is binary, and frequency is an artificial log-frequency-like scale. These synthetic values are not human-subject results.
Optional foundations#
R functions and coding habits: vectors, functions, documentation, and notebook discipline.
Matrix refresher: dimensions, transposes, rank, and regression notation.
Calculus refresher: derivatives, logarithms, and expectations.
These references support the investigations. You need not memorize every command: you should be able to explain it and check its result.
Version control and reproduction#
Create a repository using your institution’s current access requirements. Separate raw and derived data, exclude credentials and restricted participant records, and commit code, schemas, environment specifications, and documentation. Inspect diffs before accepting changes. Use the current instructor-provided submission destination.
For Git authentication, follow the current GitHub authentication documentation, rather than embedding a token in a notebook. Use restricted or synthetic examples when needed, and share only material you have permission to share.
Reading references#
Use the second edition of R for Data Science for current tidyverse practice and the official ISL site for the R second edition and optional Python companion. The renv documentation explains recording and restoring R dependencies.