When you’re stuck
Most of the time students lose in this course goes to errors that someone else already hit. This page lists the common ones with their causes and fixes. Read the short sections below first, then find your message in the tables.
How to read an error message
An error is R telling you where it gave up. Three habits make it easier to use.
- Read the first error, not the last. When a notebook stops, the first message is the cause, and later messages are usually fallout from it. If a render shows five red messages, work on the top one.
- Find the step. The error names a line or chunk, and the notebook’s headings (Step 2, Step 3, …) tell you which step it belongs to. Scroll to that chunk.
- Read the words of the message. Many messages in our notebooks are written for you and say what to fix (“Fix or remove these selections CSVs”, “The Plots pane is too small”). Read it aloud to your team before you search for anything.
Some terms used below:
- Console: the pane in RStudio where you type R code and see output.
- Chunk: a block of R code in a notebook, shown in its own gray box. A notebook runs its chunks from the top.
- Render: run the whole notebook from the top and produce the finished page. It is the best test that your work is reproducible.
- Path: the text that tells R where a file is, for example
species-group/species/recording.wav. - CSV: a plain text table, one row per line, with columns separated by commas.
The 10-minute rule
Try on your own for about ten minutes. In that time:
- read the error, find the step, and check the table below;
- check that the Setup chunk ran and that you are in a fresh session (below);
- write down what you tried.
At ten minutes, ask. Post the exact error text and the chunk that produced it to your team, then to your mentor, then to Dr. Devitt. Most errors on this page have a two-line fix once someone has seen them before, so an hour of guessing is rarely worth it. Asking at ten minutes is the expected pace.
Common errors
The Setup chunk didn’t run, or the session is stale
| You see | Cause | Fix |
|---|---|---|
could not find function "tibble" (or read_any, play_wave, ggplot, …) right after you ran library(tidyverse) |
RStudio resumed an old, half-working session | Top right of RStudio: the power icon, then Quit Session. Log back in and open the notebook again. Restarting R is not enough |
could not find function "read_any" (or another helper from the notebook) |
The chunk that defines it hasn’t run in this session | Run the Setup chunk first, then the chunk that failed. Helper functions only exist after the chunk that creates them has run |
there is no package called 'warbleR' |
The package isn’t installed for your account | Post the message to your mentor. Don’t try to install packages from the Console without asking |
Files and paths
| You see | Cause | Fix |
|---|---|---|
cannot open file '...' or file not found |
The path is wrong. Recordings sit in <species group>/<species>/<file> folders, and the notebook lists the path in its file column |
Copy the path exactly as printed, folders included. Match capital letters: TJD_818.MP3 is not TJD_818.mp3 |
| The notebook can’t find its other files (selections, metadata) | A notebook looks for files in the folder it lives in | Keep the notebook and its CSVs in the same folder in your home directory |
No selections_*.csv files found |
Step 3 reads CSVs from the folder next to the notebook, and there are none yet | The data steward collects everyone’s selections_<initials>.csv into that folder first, then renders again |
Selections CSVs (Step 3 of the team template)
| You see | Cause | Fix |
|---|---|---|
missing <column names>; found <what's there> |
A CSV header doesn’t match the required column names | Re-export the CSV from R with write_csv() instead of editing it by hand |
[semicolon-delimited: re-export as a comma CSV] |
The file was opened and saved in Excel, which changed the separator | Don’t edit CSVs in Excel. Re-export from R |
More than one observer measured these files |
Two people made selections in the same recording, so their calls interleave and every interval in that file is wrong | Keep one person’s selections for each file. Re-measurements for calibration go in the calibration/ folder, not in the team folder |
Measuring
| You see | Cause | Fix |
|---|---|---|
Error in seq.default(...) : wrong sign in 'by' argument |
A call is shorter than the analysis window. meanspec() slides a window of wl samples (512 by default) along the call. A call has duration × sampling rate samples, so at 44.1 kHz a 10 ms call has 441 samples, which is fewer than 512 |
Use the current template: dom_freq_khz() now shrinks wl to the largest power of 2 that fits the call. If you have an old copy, copy the new version. To find the offending calls, sort your selections by end - start and look at the shortest. The Oct 14 deck walks through this one |
Warning: no non-missing arguments to min and Inf or -Inf in a table |
A species or group has no values for that measurement, so min() has nothing to look at |
Use the NA-safe min_or_na() and max_or_na() from Step 5 of the current template |
| A measured frequency is far from the others | The peak search picked noise (wind, an insect, hum) instead of the call | Run the outlier check in the notebook and look at the spectrogram around that call. If it’s noise, move min_khz or max_khz, and rerun so every call is treated the same |
Plots and sound
| You see | Cause | Fix |
|---|---|---|
figure margins too large or “The Plots pane is too small” |
RStudio’s Plots pane is smaller than the figure needs | Drag the Plots pane taller or wider, or click Zoom, then run the chunk again |
File is binary rather than text when you click a .wav in the Files pane |
RStudio tries to open audio as text | Don’t click audio files. Use play_wave() or play_spectro() from your notebook; the sound plays in the Viewer pane |
| Sound doesn’t play | The Viewer pane plays only files made by the helper, and only after you press play | Run the helper chunk, look in the Viewer pane (not Plots), and press the play button |
Rendering
| You see | Cause | Fix |
|---|---|---|
| The render stops partway | One chunk failed | Read the first error message and the chunk it names. Fix that chunk and render again |
| It works when you run chunks by hand but not when you render | A chunk depends on something you ran earlier in your own session, such as a variable you made in the Console | Quit Session, open the notebook, and render from the top. Whatever fails is missing from the notebook itself, so put it in a chunk |
| The render is slow and nothing seems to happen | Long recordings take minutes to read | Wait. If nothing has changed after 10 minutes, ask |
Asking Claude for help
The UT campus Claude is available to all students. The Oct 14 deck (PDF) shows the same error asked two ways. In short:
- Paste the exact error text, the chunk that failed, and your setup (RStudio on the pod, the packages involved).
- Say what works and what doesn’t. “It works for most calls but fails for some” is the clue that cracks the problem.
- Ask it to teach you: a hint first, then try a fix yourself and ask it to check your reasoning.
- Ask what any term means if you don’t know it, as we did with sampling rate and window length.
- Look up unfamiliar arguments with
?functionbefore you trust a suggestion. - Leave out undescribed species’ names and localities, and the pod’s recordings. Made-up values debug just as well.
A weak prompt (“my R code gives this error, fix it”) makes Claude guess, and it may rewrite code that was working.
Prepared with Claude Code (Claude Sonnet 5.5, Anthropic): first draft.