jsocolar / flocker

flexible occupancy estimation in R
Other
26 stars 2 forks source link

Consider changing how we create example data. #23

Closed jsocolar closed 3 years ago

jsocolar commented 3 years ago

Currently, we have a function example_flocker_data that serves no purpose other than to produce one of two example datasets (one with visit-specific covariates, one without) for use in further examples or testing.

Is this clunky compared to just including the data as an Rdata object, or brilliant, since the function + seed can regenerate the (relatively large) dataset in a very lightweight manner?

SimonCMills commented 3 years ago

I also quite like that by providing it as a function the model the data are simulated from is transparent, wheras this would be opaque if it was provided as data object. I think the function itself can be tidied up somewhat, but otherwise I think this arrangement is fine.

SimonCMills commented 3 years ago

I took a look at it and had a go at rewriting it (submitted as pull request): I think this code is more transparent, but you may disagree. It's much easier this way to allow covariates to be structured by e.g. point, species, visit or point:visit combination: sc1 and sc2 are now structured by point rather than by closure unit, and vc1 and vc2 are now structured by point:visit combination rather than by point:visit:species combination, so more reflective of the sort of data structures we actually get in reality.

jsocolar commented 3 years ago

closing this now with merge of your pr