Skip to content
Prev 484 / 523 Next

[RsR] error/warning messages with lmrob()

Hi again both -

My main question is that the lmrob() function quits seemingly randomly
sometimes, but if I just keep calling it, eventually it works fine
(although yes some time series report back errors in either case). I have
run it on a new computer with the most recent version of R and had the same
thing happen.

In any case - attached is the .rds file of the database I am running for
this. I have a function that runs lmrob() on time series of each species x
management type x location (i.e. via the "gind" variable - or "group
identifier"), which is then the subset as "DBx" from the original set "DB".
The call for running lmrob() then is:

lm_test<-tryCatch(lmrob(log(pop_status+1)~observation_year,DBx),
finlly=print(i))

I use "tryCatch" to print out where I have warnings so I can go back and
look at these species, to determine if we should include them or not given
the warnings.

I did also try your suggestion, Werner, but this did not return results for
a species, gind="perdix perdix_in_rec", and once that happened, the next
steps in the function to gather certain aspects of the results returned an
error message (as there weren't any results) and stopped the function via

 Error in dimnames(ans$coefficients) <- list(names(est), cf.nms) :
  length of 'dimnames' [1] not equal to array extent

because there are no coefficients to reference, i.e. the issue is calling
summary(lm_test)$coefficients. In any case, this species, gray partridge in
Indiana under recreational hunt management, has only three observations
over 15 years, and although they are clearly declining over that period -
but it is not the only species with only 3 observations in the time series.

In any case, I subset out this one time series and ran it again - results
are the same as without it, but it does run to the end without the error.
Any ideas why this one species is knocking this out?

Attached is the .rds file, as well as the script I am using, and the
terrestrial species .csv data file.

Thank you again!
Emily


On Mon, Aug 26, 2019 at 4:40 PM Stahel Werner A. <stahel at stat.math.ethz.ch>
wrote: