Eleutherodactylus Research Course · Fall 2026
Many of you told me you were never properly introduced to RStudio, and that you spend more time fighting it than doing the research.
That is a fair complaint. This deck is the introduction you should have had. Work through it on your own, at your notebook, in about 50 minutes.
Contents
RStudio is one window split into four panes, each with a job. A pane is just a section of the window.
| Pane (usual spot) | What it is for | You will use it to |
|---|---|---|
| Source (top left) | Shows the files you edit, such as your team’s .qmd notebook |
Write and run code |
| Console (bottom left) | Where R actually runs. You type a line and R answers | Try one line, and read error messages |
| Environment (top right) | Lists the objects R is holding in memory right now | Check that selections or w exists |
| Files / Plots / Packages / Help / Viewer (bottom right, tabs) | Files in your home folder, figures, installed packages, help pages, and web pages R opens | See a spectrogram, look up ?spectro, play audio |
If a pane is missing, use View > Panes > Show All Panes.
A notebook (.qmd) mixes writing with chunks: grey boxes of R code, each opened by a line reading {r} between triple backticks. You can run code three ways.
| Way | How | Good for | The catch |
|---|---|---|---|
| Console | Type a line and press Enter | Trying one idea | Nothing is saved in the notebook |
| Run a chunk | Click the green arrow on the chunk | Building your notebook one piece at a time | A chunk can use objects made by earlier chunks you forgot to run |
| Render | Click Render at the top of the Source pane | The finished page, run from the first line to the last | If anything fails, you get no page |
Rendering means running every chunk in order, in a clean session, and turning the result into a web page. Your notebook is only finished if it renders.
Open your pod RStudio (edupod.cns.utexas.edu, UT EID in lowercase, VPN on if you are off campus).
x <- 5 * 3 and press Enter. Look at the Environment pane.x and press Enter.y <- x + 1 and y on separate lines inside it, and click the green arrow.test.qmd when asked).Expected result.
x with the value 15.[1] 16 appears under the chunk.object 'x' not found. The Console made x, but the notebook never did, because Render starts clean.Fix it by adding x <- 5 * 3 as the first line of the chunk, and render again. This is the most common reason a notebook runs for you and fails to render.
The working directory is the folder R is currently “standing in”. When your code says "selections_ab.csv", R looks for that name in the working directory, and nowhere else.
A path is the address of a file. Two kinds:
/stor/work/FRI_Bio206_TD_Spring2026/ (the shared course folder on the pod)calibration/obs1.csvWhen you render a notebook, R stands in the folder that holds the notebook. That is why a file that works from the Console (standing in your home folder) can go missing at render time.
You do not edit files in the shared course folder. You work on your own copy in your home folder (~/).
file.copy() returns TRUE if it worked. It returns FALSE if a file with that name is already in ~/, and it will not overwrite your work. That is a safety feature. If you want a fresh copy, rename your old one first.
Keep the notebook, your selections_*.csv files, and the output in the same folder. Then relative paths just work.
In the Console:
Expected result.
getwd() prints the path to your home folder.list.files() shows the course materials, including recordings.file.copy() prints [1] TRUE the first time, [1] FALSE if you already have the file.list.files() includes team-measurement-template.qmd.Now try read.csv("not-a-real-file.csv"). You should get cannot open file … No such file or directory. That message means R looked where you told it, and the file was not there.
| Symptom | Try | Why |
|---|---|---|
| Code behaves strangely after many edits | Session > Restart R | Clears the objects in memory and reloads R. Your files are untouched |
| A notebook works only when you run chunks in a certain order | Restart R, then Render | Shows what a fresh run does |
Functions that were fine are “not found”, even right after library(tidyverse) |
Quit Session (the power icon, top right), then log back in | A suspended session can be left broken, and Restart R does not fix it |
| The page will not load, or RStudio is frozen | Quit Session, then reload the browser tab | Same |
Quit Session ends your session on the pod and starts a fresh one when you log back in. It does not delete your files. Do this before you spend an hour debugging packages.
Error in seq.default(...) : wrong sign in 'by' argument
An error has parts:
Error in names the function that stopped. Here it is seq.default, which may be buried inside a function you called (meanspec()).Three rules:
A warning is not an error. R kept going, but check that the result makes sense.
A package is a bundle of functions someone wrote. library(seewave) loads one for this session. You need to load it every time you start R.
| You see | It usually means | Try |
|---|---|---|
could not find function "spectro" |
The package is not loaded | Run the library() lines from the Setup chunk |
there is no package called 'warbleR' |
It is not installed | Ask a mentor. On the pod, installing can fail for reasons you can’t fix |
could not find function "play_wave" |
It is a helper we wrote, defined in a notebook chunk | Run the chunk that defines it (Setup) |
The same error after you ran library() |
The suspended session is broken | Quit Session |
On the pod, RStudio uses R 4.5.3. If someone sends you code that worked on their laptop, versions may differ.
In the Console, run these one at a time:
Expected result.
Tibble columns must have compatible sizes. The message tells you the sizes: Size 3: Existing data and Size 2: Column b. You gave one column 3 values and the other 2.could not find function "spectro", because library(seewave) has not been run. Run it and try again: you now get a different error, which means you moved past the first one.Write down, for each error, the function that stopped and the one sentence R gave you.
Clicking a .wav in the Files pane does not play it: RStudio tries to open it as text and says File is binary rather than text. That is expected.
Our notebooks use the Viewer pane instead:
play_spectro() slow the sound, which also lowers its pitch.Both functions are defined in the Setup chunks of the team notebooks. If you get could not find function "play_wave", run Setup first.
Milestone 2 asks for a notebook that renders from scratch. That means a classmate could open it in a fresh session, click Render, and get your result, with nothing left over from your own Console.
Test it yourself, in this order:
If it stops, the first error tells you what the notebook was borrowing from your old session: an object you made in the Console, a package you loaded by hand, a file in the wrong folder. Fix that, and render again.
?function_name (2 min)How to ask a mentor or Claude: paste the exact error, the chunk that failed, and what you expected. Say what works and what does not. Details are in the Oct 14 deck, Asking Claude for help with R.
Do not paste recordings, or names or localities of undescribed species, into Claude. Made-up values debug just as well.
Need a PDF from a notebook on the pod? Use format: typst, never format: pdf. The pod’s TeX install is missing fonts, so pdf will fail.
Prepared with Claude Code (Claude Sonnet 5.5, Anthropic): slides and first draft.
ut-fri-biodiversity.github.io/eleuth-calls