Error Message in SPACECAP

191 views
Skip to first unread message

Kanchan Thapa

unread,
Jun 13, 2014, 3:09:56 PM6/13/14
to spacec...@googlegroups.com
Hi all

Recently i came with this error while running the SPACECAP. Please let me know the problem with it

Error in `[<-`(`*tmp*`, i, 1:length(od), value = c(16L, 17L, 18L, 19L,  :
  subscript out of bounds

Any help highly appreciated.

Kanchan

Anna Vitkalova

unread,
Apr 2, 2015, 10:56:40 PM4/2/15
to spacec...@googlegroups.com
Hello Kanchan
Have you solved this problem? I've just met the same. And I have no idea what to do.

суббота, 14 июня 2014 г., 6:09:56 UTC+11 пользователь Kanchan Thapa написал:

Jeffrey Royle

unread,
Apr 2, 2015, 11:06:11 PM4/2/15
to vitkalov...@gmail.com, spacec...@googlegroups.com
I believe this is because there are too many nearest neighbors because possibly the pixel size is too fine. So use a coarser state-space grid. (maybe Arjun can confirm this).
I thought we fixed this... are you using the most recent version of SPACECAP?


--
You received this message because you are subscribed to the Google Groups "SPACECAPforum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spacecapforu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

arjungswamy .

unread,
Apr 3, 2015, 5:05:12 AM4/3/15
to jar...@gmail.com, spacec...@googlegroups.com, vitkalov...@gmail.com

Yes, please confirm you are using the latest version of SPACECAP. If problem persists, it may be a specific problem that we are encountering with you dataset. In that case please describe it in an email to me off this forum, and we can sort it out.
Regards
Arjun

ardia...@wcs.org

unread,
Nov 29, 2015, 3:33:15 AM11/29/15
to SPACECAPforum, jar...@gmail.com, vitkalov...@gmail.com
Dear all,

I am also having the same problem with Kanchan and Anna. Error in `[<-`(`*tmp*`, i, 1:length(od), value = c(16L, 17L, 18L, 19L,  : subscript out of bounds. Did you already figure out what happened? Is it because of the dataset from the file Habitat Center? 

arjungswamy .

unread,
Nov 29, 2015, 3:55:07 AM11/29/15
to ardia...@wcs.org, jar...@gmail.com, vitkalov...@gmail.com, SPACECAPforum

Hi:

I recollect having solved this issue with Anna. Anna, could you share what had happened? If not, I will sort this out during the week off this forum. Let us wait from Anna first.

Arjun

Jeffrey Royle

unread,
Nov 29, 2015, 9:30:01 AM11/29/15
to arjungswamy ., ardia...@wcs.org, Анна Виткалова, SPACECAPforum
we had this error many times in the old version of SPACECAP. It should not be happening anymore.
The problem was due to having too fine of a resolution state-space and thus producing too many "nearest neighbors" for any particular state-space point than is allowed in the (old version) of the code.

If this is not the problem, which can be resolved by using the new version of SPACECAP, then I'm not sure what else it could be....

ardia...@wcs.org

unread,
Nov 29, 2015, 10:52:44 AM11/29/15
to SPACECAPforum, arjun...@gmail.com, ardia...@wcs.org, vitkalov...@gmail.com
Dear Mr Arjun and Jeffrey,

Thank you for the response. I am using the new version of SPACECAP 1.1.0 and set the 580x580 m spacing between points, we have used the same area pixel size (0.336 km square) in another site and it worked. 

salam,
Ardian  

Arjun Gopalaswamy

unread,
Nov 30, 2015, 6:34:09 AM11/30/15
to ardia...@wcs.org, SPACECAPforum, vitkalov...@gmail.com
Dear Ardian:

I now recollect I had introduced additional checks on the likelihood and also changed the grid resolution to make things work.

Try this:

Attached, please find a modified piece of SPACECAP R code. I have introduced a few likelihood checks in this version that makes it a little more robust, which may be necessary under certain conditions of low sample size.
What you will need to do to run this is as follows:
  1. Open the attached file in a text editor
  2. Copy contents to clipboard.
  3. Paste in R console and press Enter. After a few seconds the R prompt will show up again.
  4. Type SPACECAP() and press Enter.

Follow the usual steps.

Do let me know if this works.

Regards
Arjun




On 29/11/2015 15:52, "ardia...@wcs.org" <ardia...@wcs.org> wrote:

Dear Mr Arjun and Jeffrey,

Thank you for the response. I am using the new version of SPACECAP 1.1.0 and set the 580x580 m spacing between points, we have used the same area pixel size (0.336 km square) in another site and it worked. 

salam,
Ardian  

On Sunday, November 29, 2015 at 9:30:01 PM UTC+7, Jeffrey Royle wrote:
we had this error many times in the old version of SPACECAP. It should not be happening anymore.
The problem was due to having too fine of a resolution state-space and thus producing too many "nearest neighbors" for any particular state-space point than is allowed in the (old version) of the code.

If this is not the problem, which can be resolved by using the new version of SPACECAP, then I'm not sure what else it could be....

On Sun, Nov 29, 2015 at 3:55 AM, arjungswamy . <arjun...@gmail.com <javascript:> > wrote:

Hi:

I recollect having solved this issue with Anna. Anna, could you share what had happened? If not, I will sort this out during the week off this forum. Let us wait from Anna first.

Arjun

On Nov 29, 2015 2:03 PM,  <ardia...@wcs.org <javascript:> > wrote:
Dear all,

I am also having the same problem with Kanchan and Anna. Error in `[<-`(`*tmp*`, i, 1:length(od), value = c(16L, 17L, 18L, 19L,  : subscript out of bounds. Did you already figure out what happened? Is it because of the dataset from the file Habitat Center? 

On Friday, April 3, 2015 at 4:05:12 PM UTC+7, Arjun Gopalaswamy wrote:
Yes, please confirm you are using the latest version of SPACECAP. If problem persists, it may be a specific problem that we are encountering with you dataset. In that case please describe it in an email to me off this forum, and we can sort it out.
Regards
Arjun

On Apr 3, 2015 4:06 AM, "Jeffrey Royle" <jar...@gmail.com> wrote:
I believe this is because there are too many nearest neighbors because possibly the pixel size is too fine. So use a coarser state-space grid. (maybe Arjun can confirm this).
I thought we fixed this... are you using the most recent version of SPACECAP?


On Thu, Apr 2, 2015 at 10:56 PM, Anna Vitkalova <vitkalov...@gmail.com> wrote:
Hello Kanchan
Have you solved this problem? I've just met the same. And I have no idea what to do.

суббота, 14 июня 2014 г., 6:09:56 UTC+11 пользователь Kanchan Thapa написал:
SPACECAP-30Nov15-Ardian-LikelihoodChecks.R

Ardiantiono .

unread,
Nov 30, 2015, 7:46:32 AM11/30/15
to Arjun Gopalaswamy, SPACECAPforum, vitkalov...@gmail.com
It works! Thank you Mr Arjun! 

I am trying to understand the script that you sent to me. Is it because of the Habitat Center dataset Mr Arjun?

Salam,
Ardian

Click here to report this email as spam.




--
   
Ardiantiono
Sumatra Database Support, Indonesia
Wildlife Conservation Society
tel: | skype: Ardiantiono -
web: www.wcs.org
twitter: www.twitter.com/thewcs

Arjun Gopalaswamy

unread,
Nov 30, 2015, 8:05:52 AM11/30/15
to Ardiantiono ., SPACECAPforum, vitkalov...@gmail.com
Hi Ardian:

I have essentially set the “gridres” to 2 (10 is the default value) and I have introduced likelihood checks in this version.

Arjun
On Thu, Apr 2, 2015 at 10:56 PM, Anna Vitkalova <vitkalov...@gmail.com <http://vitkalov...@gmail.com> > wrote:
Hello Kanchan
Have you solved this problem? I've just met the same. And I have no idea what to do.

суббота, 14 июня 2014 г., 6:09:56 UTC+11 пользователь Kanchan Thapa написал:
Hi all

Recently i came with this error while running the SPACECAP. Please let me know the problem with it

Error in `[<-`(`*tmp*`, i, 1:length(od), value = c(16L, 17L, 18L, 19L,  :
  subscript out of bounds

Any help highly appreciated.

Kanchan


Ardiantiono .

unread,
Nov 30, 2015, 8:09:43 AM11/30/15
to Arjun Gopalaswamy, SPACECAPforum, vitkalov...@gmail.com
Thank you Mr Arjun for the big help! I'm so glad I can run the analysis now! :)

Ardian
Message has been deleted

Sarah_AfriCat

unread,
Oct 6, 2018, 4:51:25 AM10/6/18
to SPACECAPforum
Hi
I was having the same error message and used the R script Mr Arjun posted.  However, at the end of the analysis run I get the error:

Error in apply(newout, 2, hdi) : object 'hdi' not found


Please can you help with this?  Maybe it is something small  - would highly appreciate

Sarah
Reply all
Reply to author
Forward
0 new messages