SNStatComp / rtrim

Reimplementation of TRIM for R
10 stars 1 forks source link

debug browser invoked when running trim model #16

Closed MartinStjernman closed 6 years ago

MartinStjernman commented 6 years ago

Dear Mark, I recently started working with the rtrim package and am running trim models for a large set of species. For some species I run into problems due to sparse data. As I loop through the species and I don't want the loop to stop due to errors I'm using tryCatch() to gather the error messages rather than model object for problematic species. However, for (at least) one species tryCatch don't seem to work because the execution of the trim()-function is interrupted and debugging starts by invoking browser(). According to the traceback the browser seems to be invoked by update_V() in trim_workhorse(). For some of the problematic species execution can continue by entering c at the Browser prompt but others the only way to exit is to entering Q which results in a halt of the run all together.
This is my trim model: test <- trim(count~site2 + time, data = dat , model = 2, overdisp = TRUE, serialcor = TRUE, changepoints = 'all', autodelete = TRUE)

Now, to me it seems odd that the end user of rtrim end up in debugging mode when running the code and suspect that it's not meant to be this way. In any way I would appreciate any input on how to solve this problem such that I can continue the looping through species without entering (and not being able to escape from) debugging mode.

Any help is highly appreciated.

Sincerely Martin

I'm running R using Rstudio 1.0.153. Here is my sessionInfo:

sessionInfo() R version 3.4.2 (2017-09-28) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale: [1] LC_COLLATE=Swedish_Sweden.1252 LC_CTYPE=Swedish_Sweden.1252 LC_MONETARY=Swedish_Sweden.1252 [4] LC_NUMERIC=C LC_TIME=Swedish_Sweden.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] rtrim_1.0.1 RODBC_1.3-15

loaded via a namespace (and not attached): [1] compiler_3.4.2 tools_3.4.2

pwbogaart commented 6 years ago

Solved in rtrim 2.0.03 (on CRAN now)