Error in X [, pstart [i] - 1 + 1: object $ nsdf [i]] <- Xp: number of items to replace is not a multiple of replacement length "

16 views
Skip to first unread message

Barbara Soto

unread,
Dec 5, 2021, 8:35:47 PM12/5/21
to distance-sampling
Hi
My name is Bárbara Soto and I am making some density models on guanaco populations in the commune of San Gregorio, Magallanes, Chile
The truth is that I am quite new to this and I have already made progress by making several models and combinations of variables but I have had some problems when performing the rqgam.check, which only delivers the Resids vs linear pred graph and not the others. .
On the other hand, when I try to make the prediction with the following command "dsm.pred <- predict (dsm18.3tw, preddata2016, preddata2016 $ area)" I get the following error: "Error in X [, pstart [i] - 1 + 1: object $ nsdf [i]] <- Xp:
   number of items to replace is not a multiple of replacement length "
I know more or less what you mean, but I don't understand why this error is occurring and how to fix it.

Beforehand thank you very much

Len Thomas

unread,
Dec 5, 2021, 9:07:00 PM12/5/21
to distance...@googlegroups.com
Hi Bárbara,

It's hard to diagnose what might be happening from this description.
Perhaps you could send me, to my email address, enough data and code
that I can reproduce what you see on my machine, and I'll try to
determine what the problem might be. Once we've worked it out, we can
post back to the list what the solution was (assuming we find one!).

Best wishes, Len Thomas
> --
> You received this message because you are subscribed to the Google
> Groups "distance-sampling" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to distance-sampl...@googlegroups.com
> <mailto:distance-sampl...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/distance-sampling/ae308f2c-afd0-4cc6-92e6-7948d23ef83dn%40googlegroups.com
> <https://groups.google.com/d/msgid/distance-sampling/ae308f2c-afd0-4cc6-92e6-7948d23ef83dn%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
I am a member of the University and College Union and am currently
participating in industrial action to improve UK higher education
staff pension, pay, equality and working conditions. For more
information, please see
https://www.ucu.org.uk/article/11896/Why-were-taking-action.

--
Len Thomas (he/him) len.t...@st-andrews.ac.uk lenthomas.org @len_thom
Centre for Research into Ecological and Environmental Modelling
and School of Mathematics and Statistics
The Observatory, University of St Andrews, Scotland KY16 9LZ
Office: UK+1334-461801 Admin: UK+1334-461842

While I may be sending this email outside of my normal office hours,
I have no expectation to receive a reply outside of yours.

The University of St Andrews is a charity
registered in Scotland, No SC013532.

Eric Rexstad

unread,
Dec 6, 2021, 3:08:23 AM12/6/21
to distance...@googlegroups.com
Bárbara

I have an answer to your first question regarding rqgam.check​.  That function has been revised in recent versions of the package and comes with this description in the details:

Reproduces the "Resids vs. linear pred" plot from gam.check but using randomised quantile residuals...  Earlier versions of this function produced the full gam.check output, but this was confusing as only one of the plots was really useful. Checks of k are not computed, these need to be done using gam.check.

Therefore calling rqgam.check​ will only produce a single plot of residuals against the linear predictor.


From: 'Len Thomas' via distance-sampling <distance...@googlegroups.com>
Sent: 06 December 2021 02:06
To: distance...@googlegroups.com <distance...@googlegroups.com>
Subject: Re: [distance-sampling] Error in X [, pstart [i] - 1 + 1: object $ nsdf [i]] <- Xp: number of items to replace is not a multiple of replacement length "
 
To unsubscribe from this group and stop receiving emails from it, send an email to distance-sampl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/distance-sampling/06996b8b-e69a-7856-d1cf-870e74ccfe11%40st-andrews.ac.uk.
Reply all
Reply to author
Forward
0 new messages