DistanceDevelopment / spatial-workshops

Distance sampling workshop content
http://distancesampling.org/workshops/
2 stars 0 forks source link

When 2-detection-functions.Rmd is run, distdata$SegmentID will not exist yet #33

Closed jjrob closed 8 years ago

jjrob commented 8 years ago

https://github.com/DistanceDevelopment/spatial-workshops/blob/master/exercises/2-detection-functions.Rmd uses the SegmentID of the Sightings table to populate distdata$Sample.Label. But when we are running this exercise--the afternoon of the first day--we won't have created the segments yet (see #32). At this point, the Sightings table will not have a SegmentID field yet. (Alternatively, we can give it one but leave it with NULL values, translated to NA in R).

We need to remove use of SegmentID from this exercise. Is this ok? I believe yes; I believe ds() does not require Sample.Label. So we should just be able to strip it out.

Do we also need to fix up https://github.com/DistanceDevelopment/spatial-workshops/blob/master/exercises/2-detection-functions-solutions.Rmd ?

dill commented 8 years ago

going to try this on a "fresh machine" this afternoon, but some initial observations

This works fine with the Exercise_Day1.zip data you sent. Using data from the resulting run of 2-detection-functions.Rmd with 1-process-geodata.Rmd and 3-simple-dsms.Rmd results in working code/models/data.

You are correct that the segment data is not needed, but actually:

distdata$Sample.Label <- distdata$SegmentID

doesn't throw an error, as you're assigning NULL to NULL (but I've removed it anyway in 44509e7).

(Leaving this open until I run on another machine.)

dill commented 8 years ago

This runs fine with Exercise_Day1.zip data.