DistanceDevelopment / Distance

Simple distance sampling analysis
GNU General Public License v3.0
9 stars 8 forks source link

Breaking changes from `dht2` `object` field requirement #139

Closed dill closed 1 year ago

dill commented 1 year ago

dht2 now requires the object field in flatfile formatted data. This breaks some examples etc and we need to ensure that the data shipped with Distance conforms to this new format, that the examples site data also is formatted correctly and check our workshop teaching examples.

lenthomas commented 1 year ago

I'll fix the CTDS workshop materials.

lenthomas commented 1 year ago

@Erex, @dill is going to fix the distanceexamples that use dht2 but I wonder if you use it on your workshop at all - in that case, your code will need updated to have an object field in the flatfile.

dill commented 1 year ago

For reference, this code searches through Distance data and prints which sets lack an object field:

# check that all data included in Distance has an object field

library(Distance)

datasets <- data(package="Distance")

datasets <- datasets$results[,3]

datasets <- datasets[!grepl("_units", datasets)]

for(dd in datasets){
  data(list=dd)
  if(is.null(get(dd)$object)) cat(dd, "\n")
}
dill commented 1 year ago

The duiker analysis at https://examples.distancesampling.org/Distance-cameratraps/camera-distill.html seems to be the only example which this breaks. Currently re-running the analysis in isbjørn.

dill commented 1 year ago

I've uploaded the corrected version of the camera trap analysis here https://examples.distancesampling.org/Distance-cameratraps/camera-distill.html and it should update momentarily.

lenthomas commented 1 year ago

Looks good to me. Perhaps we could point to that in the release posting as an example of how one might go about getting an object ID into a flatfile - it's just 2 lines of code!