Welcome to your final lab, where we are going to focus on Point Pattern Analysis, a specific set of spatial statistics tools we are can use for point datasets. A point dataset can be anything with a specific location, from stars, to greenhouses.
We will be focusing on:
Uniquely for this lab, I am providing most of the code! Your job is to get it running for a new dataset on fossils and dinosaurs in Pennsylvania.
See your canvas assignment here.
Need help? Add a screenshot/question to the discussion board here: LAB 7 DISCUSSION BOARD
YOU WILL NOT BE GRADED ON ANYTHING IN THIS TUTORIAL.
THERE SHOULD BE NO CODE/TEXT IN YOUR FINAL REPORT ABOUT IOWAN FARMERS MARKETS!
Set up your lab 8 project. If you can’t remember, instructions are in Tutorial 2c or previous labs.
Go to Canvas and download the .Rmd with the code, the data file on fossils and the worked example data file on farmers markets in Iowa. Put them in your project folder.
Use the code provided to work through Tutorial 12. Make sure all the libraries are installed, all the code chunks run, that it knits, and that there are no errors.
If there are any issues here, make sure to ask for help ASAP.
You will be conducting your analysis on a dataset on fossils in Pennsylvania. The data comes from a Paleobiology database that is maintained by an international non-governmental group of paleontologists.
Step 1: Original Data
The data is stored here: https://paleobiodb.org/#/, with a nice interface. Explore the data and any patterns. Also note how the data was collected and who by. You will need this for step 2..
Step 1b: Clear your workspace
You don’t want Iowa stuff hanging around. Either click the broom in environment or run this command in the console:
rm(list=ls())
Step 2: Set up your report
Edit the YAML code in the script so that it looks professional when knitted. At the top (under an appropriate heading), write a brief description of the data, including the scale/unit of analysis, how the data was collected and who by. (remember you can read the data into R and come back to this.. ).
Step 3: Read the data into R
Edit the code so that it reads the fossil data into R, converts it to sf format and sets an appropriate UTM map projection (remember to look at the column names for the coordinates in the st_as_sf command..)
Step 4: Initial patterns
Make some good looking plots of the points (feel free to change my code). Write a paragraph on what you might think causes this pattern of dinosaur fossils. This is a real life example, so feel free to google if you are new to dinosaurs…..
Troubleshooting. You can run each individual line of code in turn by clicking on it and pressing command-enter / ctrl-enter.
If it turns out that you are still seeing Iowa stuff, go back to step 1b, then very slowly run the code from the top, line by line until you discover the error.
Step 5: Read in secondary data into R
I wish to know what the pattern of fossils looks like and whether it is determined by elevation (maybe the mountains have different rocks) or population density (more people digging..)
Hint. If you decide on census tract data, you will need to deal with empty geometries AKA Lab 7.
Step 6:Convert your data to ppp
Keep following the tutorial code to convert your data to ppp. YOUR CODE SHOULD SUCCESSULLY KNIT AT THIS POINT. If there are errors, fix them before moving forward
In the text explain if your data is marked and what that means. Also, in your own words, describe the spatstat package itself (you can get the show me something new marks for properly referencing it, see the end for more)
Step 7:Conduct a density based analysis
Your analysis should include:
You DO NOT have to complete a regression analysis. The code is simply here for those with point projects
Step 8:Conduct a distance based analysis
Your analysis should include:
Step 9:Show me something new
For example, you could add contours to plots, use different plotting commands than tmap, really improve some tmap plots. You could find out how to reference things properly in R markdown or include a relevant quote (using R markdown quote format) to your fossil analysis.
You could also look at some other point pattern tutorials because they are all linked into spatstat. There are loads of things you could do to build your knowledge of point pattern analysis
Remember to say what you did in the report.
Remember to save your work throughout and to spell check your writing (left of the knit button). Now, press the knit button again. If you have not made any mistakes in the code then R should create a html file in your lab 8 folder which includes your answers. If you look at your lab 8 folder, you should see this there - complete with a very recent time-stamp.
In that folder, double click on the html file. This will open it in your browser. CHECK THAT THIS IS WHAT YOU WANT TO SUBMIT
Now go to Canvas and submit BOTH your html and your .Rmd file in Lab 8.
For all answers: Full marks = everything down at a high standard, in full sentences as appropriate with no parts of your answer missing. Imagine it as an example I use in class
HTML FILE SUBMISSION - 5 marks
RMD CODE SUBMISSION - 5 marks
MARKDOWN STYLE - 10 MARKS
We will start by awarding full marks and dock marks for mistakes.LOOK AT YOUR HTML FILE IN YOUR WEB-BROWSER BEFORE YOU SUBMIT
TO GET 13/13 : All the below PLUS you use subscripts/superscript as appropriate
TO GET 12/13 - all the below:
Step 2: Your description of the data: 8 MARKS
You have thoughtfully described the data and included all the information expected in previous labs, or to allow someone to reproduce it.
Step 3, 4, 5: Excellent maps: 10 MARKS
You have made excellent maps and described the spatial patterns in the data and your expectations/theories about what causes the pattern.
6/8 max for simply getting my maps to run. More marks for making them your own
Step 6 ppp 8 MARKS
You have made excellent maps and described the spatial patterns in the data and your expectations/theories about what causes the pattern.
6/8 max for simply getting my maps to run. More marks for making them your own
Step 7 density analysis 25 MARKS
You did all that was requested
Step 8 distance analysis 25 MARKS
You did all that was requested
Above and beyond: 4 MARKS
Overall, here is what your lab should correspond to:
Grade | % Mark | Rubric |
---|---|---|
A* | 98-100 | Exceptional. Not only was it near perfect, but the graders learned something. THIS IS HARD TO GET. |
NA | 96+ | You went above and beyond |
A | 93+: | Everything asked for with high quality. Class example |
A- | 90+ | The odd minor mistake, All code done but not written up in full sentences etc. A little less care |
B+ | 87+ | More minor mistakes. Things like missing units, getting the odd question wrong, no workings shown |
B | 83+ | Solid work but the odd larger mistake or missing answer. Completely misinterpreted something, that type of thing |
B- | 80+ | Starting to miss entire/questions sections, or multiple larger mistakes. Still a solid attempt. |
C+ | 77+ | You made a good effort and did some things well, but there were a lot of problems. (e.g. you wrote up the text well, but messed up the code) |
C | 70+ | It’s clear you tried and learned something. Just attending labs will get you this much as we can help you get to this stage |
D | 60+ | You attempt the lab and submit something. Not clear you put in much effort or you had real issues |
F | 0+ | Didn’t submit, or incredibly limited attempt. |
Website created and maintained by Helen Greatrex. Website template by Noli Brazil