BiologicalRecordsCentre / BRCindicators

An R package for creating indicators from trends data
4 stars 11 forks source link

Metacoding of BMA options #48

Closed drnickisaac closed 4 years ago

drnickisaac commented 4 years ago

I've streamlined the BMA options: only four now work. Three of them call a single function, which assembles the BUGS code in pieces, from function calls with options.

AugustT commented 4 years ago
get_bmaBUGScode(option="smooth_det", print.screen=TRUE, save.local=FALSE)
Error in smoothing() : could not find function "smoothing"
Calls: get_bmaBUGScode -> bma_model_smooth_det -> paste

I'm not sure why this call is upset about the snoothing function. All functions you define should be available internally and only need to be exported if called directl by the user.

Also, I suggest you write a simpl test script that runs the examples you have written. You will find these bugs much faster that way as you can test locally (Ctrl+Shift+T) rather than waiting for travis.

drnickisaac commented 4 years ago

I keep seeing easy ways to fix my bugs (easier than writing a test!). The last one was because I meta-coded three of the four options but the fourth relies on a function that was inside another function, not globally available.

drnickisaac commented 4 years ago

@AugustT is this an error or can it be merged?

AugustT commented 4 years ago

This is ready to merge