You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: s4/index.qmd
+10-79Lines changed: 10 additions & 79 deletions
Original file line number
Diff line number
Diff line change
@@ -23,12 +23,15 @@ In this session, we will learn how to use origin-destination data. To do that we
23
23
24
24
# Review Homework
25
25
26
-
Your homework last week was to review some AI written code. Divide into groups of 2-3 people and share the question you asked AI, the code it produced, and the results it got.
26
+
In the previous session and for your homework, you used AI to assist with loading datasets, creating visualizations, and working through vignettes on origin-destination (OD) using the `od` and `pct` packages. Let's evaluate your findings in groups of 2-3.
27
27
28
-
* Does the code run first time?
29
-
* Do the results answer the question?
30
-
* Try modifying the code and the prompt to improve the code generated by the AI.
31
-
* Discuss in your groups the strengths and weaknesses of AI written code.
28
+
***The Workflow**: Show your group the specific prompts you gave the AI, the code it generated, and the resulting output.
29
+
30
+
***The "First Run"** Test: Did the code run the first time? If it failed, what caused the error (e.g., outdated library syntax, incorrect file paths, or spatial projection issues)?
31
+
32
+
***Accuracy**: Did the AI truly understand the spatial logic of data, or did it just provide a generic visualization?
33
+
34
+
***Refinement**: Share how you modified your prompts or the code itself to achieve a better, more accurate result.
32
35
33
36
# Getting started with GIS in R
34
37
@@ -1073,79 +1076,7 @@ bike_trips |>
1073
1076
# Homework
1074
1077
1075
1078
1. Read Chapters 2-5 of [Geocomputation with R](https://r.geocompx.org/transport.html)
1076
-
2. Using knowledge about datasets and new skills covered in the practicals 2 and 3, think of a simple research question that could be answered by analysing/visualising/modelling one of the datasets imported into R in your previous homework (or another dataset you have imported into R).
1077
-
3. Write a prompt, starting with your own code that imports the code, to generate some code answering the question and write it down in a new Quarto file called `gen-ai-test.qmd`.
1078
-
4. Copy the prompt and paste it into a generative AI chat interface such as [ChatGPT](https://chatgpt.com), [Claude](https://claude.ai/), [DeepSeek](https://chat.deepseek.com/) or [Gemini](https://gemini.google.com/)
1079
-
5. Paste the resulting code into a code chunk in a new .qmd file, e.g. called `gen-ai-test.qmd`.
1080
-
- Does the code run first time?
1081
-
- Do the results answer the question?
1082
-
- Try modifying the code and the prompt to improve the code generated by the AI.
1083
-
- Note: in the next practical session we will review the AI-generated code you will share the code with a colleague and they will try to run it.
1084
-
6. Bonus: try setting-up Copilot or other code auto-completion system in RStudio using the documentation at
[docs.posit.co](https://docs.posit.co/ide/user/ide/guide/tools/copilot.html) or VSCode using the [GitHub Copilot](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot) extension.
1087
-
7. Bonus: share your code on GitHub, for example by pasting it into the discussion group at [github.com/ITSLeeds/TDS/discussions](https://github.com/itsleeds/tds/discussions/172) or by creating a repo on your own GitHub account.
1088
-
8. Bonus: Read more about using the [tmap package](https://r-tmap.github.io/tmap/)
1089
-
9. Bonus: Read more about the [ggplot2 package](https://ggplot2.tidyverse.org/)
1090
-
1091
-
<details>
1092
-
1093
-
I wrote the following prompt:
1094
-
1095
-
Starting with the following R code that starts by loading the tidyverse and stats19 R packages, write a script that finds out which local authorities saw the greatest percentage point decrease in the number of road traffic collisions between 2019 and 2020.
1096
-
Explore this relationship for the total number of collisions with summary statistics, ggplot2 visualisations, and perhaps a basic model. Furthermore, explore how the % change in collision numbers vary depending on factors such as urban or rural area, casualty severity, and the month used for comparison.
0 commit comments