Browse real data sources, load a candidate in R, and draft your Milestone 1
2026-07-05
read_csv(), glimpse(), dim(), and head()How to use this worksheet
- Work through the parts in order — each one feeds your Milestone 1 paragraph at the end.
- Blocks marked ▶ Adapt this are code templates: change the file path / column names to your dataset and run them.
- Blocks marked ✏️ Your turn ask you to write, decide, or interpret.
- The Going further section is optional.
🔮 Predict before you run — and type, don’t paste
Before you run any code block on your dataset, predict what you’ll see: how many rows? which columns are numeric? Then run it and compare. Guessing first turns “looking at data” into actually understanding it — and typing the code yourself (rather than pasting) builds the habits that make Milestones 2–5 fast.
Before you look at any data, decide what you actually care about. You are far more likely to finish a project on a topic you find interesting.
✏️ Your turn: Write one topic you can’t stop thinking about, and a first guess at a question.
Topic:
A rough question about it:
Open three of these in your browser and skim what they offer. Aim for at least one that could feed your topic from Part 1.
Ecology / environment: GBIF gbif.org · EDI edirepository.org · NEON data.neonscience.org · Dryad datadryad.org · NOAA-GLERL ice glerl.noaa.gov/data/ice · eBird ebird.org/science
Fun / engaging: Bigfoot, UFO, Coffee, Video-game sales — all on kaggle.com/datasets
General: Our World in Data ourworldindata.org · FiveThirtyEight github.com/fivethirtyeight/data · Bike Sharing archive.ics.uci.edu · Google Dataset Search datasetsearch.research.google.com
✏️ Your turn: List the three you visited and one dataset that caught your eye at each.
Source 1: Dataset / idea:
Source 2: Dataset / idea:
Source 3: Dataset / idea:
Pick your favorite candidate and download it as a CSV (or similar) into your project’s data/ folder.
✏️ Your turn: Record where it came from.
Dataset name:
Source URL:
File name saved in data/:
File type (csv / txt / xlsx):
⚠️ Watch out! Start small — filter to CSV and files under 10 MB. You can always scale up later. If it only downloads as
.xlsx, that’s fine — you’ll useread_excel()instead ofread_csv().
Now the real test: can you get it into R?
▶ Adapt this (change the file name to yours):
🔮 Predict first: before you run the next block, guess how many rows and columns the file has. Write your guess, then check.
▶ Adapt this:
✏️ Your turn: Fill in what you found.
Rows: (need at least 50 — Y / N)
Columns: (need at least 3 — Y / N)
What does ONE row represent (a day? a person? a sighting?):
Did read_csv() load it cleanly? Y / N — if not, what error:
Look at the glimpse() output. Column types tell you their role: <dbl>/<int> are numeric (possible Y), <chr>/<fct> are categorical (possible grouping X).
✏️ Your turn: Choose your variables.
Response variable Y (numeric — the thing you want to explain):
Its type (<dbl> / <int>):
Predictor variable X:
Its type (numeric / categorical):
If categorical, how many groups does it have?
✏️ Your turn: Any missing values to worry about? (Look for NA in glimpse()/head(), or count them.)
▶ Adapt this:
Missing values in Y:
Will this be a problem? (remember na.rm = TRUE and sum(!is.na()))
A question is testable when you can write H₀ and Hₐ in one sentence each.
✏️ Your turn:
Question in plain English:
H₀ (null):
Hₐ (alternate):
✏️ Your turn: Match your question to a method (circle one) and say why.
Method: regression / t-test / ANOVA / regression on year
Why this method fits my X and Y:
💡 Key idea: numeric X → regression; categorical X with 2 groups → t-test; categorical X with 3+ groups → ANOVA; time on the x-axis → regression on year.
Before any analysis, draw the plot you hope to make. This is your target — the single figure that would answer your question.
✏️ Your turn: Sketch it (by hand is fine) and label the axes.
What's on the x-axis:
What's on the y-axis:
What pattern would support Hₐ (a slope? a group difference?):
Put it all together. Copy the template and fill in the blanks from Parts 3–7.
"I plan to use the __________ dataset, available at __________.
It contains approximately ____ rows and ____ columns. My predictor (X)
is __________ and my response (Y) is __________. My research question is:
__________. My null hypothesis is that __________, and my alternate
hypothesis is that __________. I plan to use __________ to test this.
I have confirmed I can load the file into R with read_csv()."
✏️ Your turn: Write your final paragraph here, then submit it to Canvas.
Your Milestone 1 paragraph:
Your M5 talk is five minutes, one story. Rough it out now while the dataset is fresh.
✏️ Your turn:
Slide 1 — the question (and why you care):
Slide 2 — the data (source, what one row is, how big):
Slide 3 — the ONE figure that shows your result:
Slide 4 — the answer in one sentence + one honest caveat:
You are ready to submit Milestone 1 when you can check every box:
✏️ Your turn: Any box unchecked? Note what’s blocking you and bring it to office hours.
What's blocking me (if anything):
Optional — do this if you finish early or want a stronger proposal.
Repeat Parts 3–5 on a second candidate. Having a backup means a dead-end dataset never sinks your project.
✏️ Your turn: Which of your two candidates is the stronger project, and why?
Your answer:
✏️ Your turn: Show your H₀/Hₐ to a classmate. Can they tell you what plot and test you’d run just from your hypotheses? If not, tighten the wording.
What you changed after their feedback:
read_csv() error: check the file is really in data/ and the name matches exactly (including .csv). Try list.files("data").read_tsv() or read_delim().library(readxl) and read_excel("data/your_file.xlsx").names(my_data_df).💡 Key idea: every dataset you’ll ever download needs this same first pass — download → load → glimpse → identify X and Y. You now have it.
End of Activity 08. Next: Lecture 09 — loading and cleaning your own dataset (Milestone 2).