Author
Affiliation

Your Name Here

Old Dominion University

Before You Start

This assignment has one job: confirm that your entire toolkit works — R, RStudio, your course R Project, your CLAUDE.md, Claude Code, and Quarto rendering — and that you can do the basics: move around RStudio, run code, read in data, and make a plot. Everything here comes from Module 1.

Setup, in order (Modules 1.3, 1.4, and 1.6 walk through all of this):

  1. Create your course folder and put the course .Rproj and CLAUDE.md files in it.
  2. Put this file in your course folder (or one subfolder deep — e.g., a homework folder inside your course folder — but no deeper).
  3. Open the project in RStudio by double-clicking the .Rproj file, then open this file.
  4. Change the author line at the top of this file to your name.
  5. Click Render right now, before doing anything else. If a document appears, you’re in business. Render early and often — do not wait until you’re finished to find out something is broken.

A note on Claude Code: you are encouraged to use it throughout this assignment — learning to work with it is part of the point, and Question 6 requires it. But this assignment covers the handful of things you’ll need at your fingertips all semester. If Claude does all of it and you retain none of it, you’re only cheating yourself.

Submit the rendered .html file on Canvas.

Question 1

(4 Points) The chunk below checks your setup. Do not edit it — just make sure it runs when you render. Full credit requires the rendered output to show .Rproj found: TRUE and CLAUDE.md course block: INTACT.

# --- Setup check: do not remove or edit this chunk ---
# canon_url <- "https://alexcardazzi.github.io/econ311/CLAUDE.md"
# 
# # Look for the .Rproj in this folder first, then one level up
# rproj_ok <- length(list.files(".", pattern = "\\.Rproj$")) > 0 |
#             length(list.files("..", pattern = "\\.Rproj$")) > 0
# 
# # Same idea for CLAUDE.md: take the first location where it exists
# claude_path <- c("CLAUDE.md", "../CLAUDE.md")
# claude_path <- claude_path[file.exists(claude_path)][1]
# 
# claude_status <- if(is.na(claude_path)) {
#   "MISSING"
# } else {
#   tryCatch({
#     local_md  <- readLines(claude_path, warn = FALSE)
#     remote_md <- readLines(canon_url, warn = FALSE)
#     if(identical(local_md[seq_along(remote_md)], remote_md)) "INTACT" else "MODIFIED"
#   }, error = function(e) "COULD NOT CHECK (no internet?)")
# }
# 
# cat(".Rproj found: ", rproj_ok, "\nCLAUDE.md course block: ", claude_status, sep = "")

Question 2

(4 Points) Take a screenshot of your RStudio window that shows all three of the following:1

  • Your project name in the top-right corner of RStudio (this proves the .Rproj is actually open).
  • The Terminal tab (bottom-left) with Claude Code running in it.
  • In that terminal, Claude Code’s answer to this exact prompt: “In one sentence: what folder are you working in, and what files do you see?”

Embed the screenshot below by replacing the file name with your own:

My RStudio setup

Question 3

(4 Points) Warm-up, straight from Modules 1.5 and 1.6. Do each part in the chunk below it.

  1. Create a character variable called my_name containing your name, and a numeric variable called birth_year containing the year you were born. Use cat() to print a sentence introducing yourself that uses both variables.
Code
# Write your code here
  1. Calculate your age in months as of January 2027, the way Module 1.5 does it, and print it. Use your real birth year and month.
Code
# Write your code here
  1. Create a vector called commutes containing these five values: 18, 25, 12, 40, 31 (minutes spent commuting on each weekday). Print the average commute time and the longest commute time.
Code
# Write your code here

Question 4

(8 Points) Go to the Rdatasets index — a catalog of over 3,000 datasets — and pick one that interests you, with two rules: it must have at least 100 rows and at least 4 columns, and it must contain at least one numeric variable. One suggestion, too: try to keep it under roughly 50,000 rows and 20 columns — bigger data isn’t better here, and giant datasets can get unruly fast. Everyone will likely be working with a different dataset. Skim its documentation page (linked in the index) so you know what the variables mean.

Some examples of possible datasets include:

  1. Read your dataset into R using read.csv() and store it as a data.frame.2
Code
# Write your code here
  1. Print the number of rows, the number of columns, and the column names.
Code
# Write your code here
  1. In 2-3 sentences (not code): what does one row of this dataset represent, and why did you pick it?

Write your answer here.

  1. Pick one variable and state whether it is nominal, ordinal, interval, or ratio (Module 1.2). Explain your reasoning in a sentence.

Write your answer here.

Question 5

(8 Points) Using your dataset from the previous question, choose two variables and make a scatterplot. Requirements: label both axes with real descriptions (not variable names like hp), use a color that is not the default black, and use pch = 19. Below the plot, describe in 2-3 sentences what the plot shows — write it for someone who has never seen this dataset.

Code
# Write your code here

Question 6

(4 Points) The chunk below contains buggy code. Copy it into your document, then work with Claude Code to find and fix the bugs.3 Show the working version, and then — in your own words, 1-2 sentences per bug — explain what each bug was.

scores <- c(88, 92, 75 81, 96)
avg_score <- mean(Scores)
cat("The average score is", avg_scores)
Code
# Write the correct code here

Question 7

(8 Points) The process reflection. In a short paragraph (4-6 sentences), in your own words — Claude Code is not allowed to write this, and it knows that:

  • How did you use Claude Code on this assignment? What did it help with most?
  • What is one thing you made sure you understood yourself rather than taking Claude’s word for it?
  • Your CLAUDE.md tells Claude to keep session logs in an ai_logs/ folder. Did it? (Go look.) If yes, did reading the log help you write this reflection?

Write your answer here.

Footnotes

  1. On Windows: Win + Shift + S. On Mac: Cmd + Shift + 4. Save the image file in the same folder as this document.↩︎

  2. Hint: the index has a CSV link for every dataset. You can read directly from the URL or download the file into your folder first — your choice. Both are covered in Module 1.6.↩︎

  3. This is the main workflow you’ll use all semester when your own code breaks: show Claude the code and the error message, and work through it. Let it explain, not just fix.↩︎