[R-sig-eco] A question about PCNM analysis

Kingsford Jones kingsfordjones at gmail.com
Sun Jul 18 21:09:42 CEST 2010


lgj200306,

You didn't tell us, but since the problem was 'all the same' on both
machines I'm guessing both instances used a 32bit build of R under
Windows.  If so, you'll be able to access, at most, about 3.5Gb of RAM
(see RW-FAQ 2.9).  The best solution is to upgrade to a 64bit build
(IMO preferrably Linux, but a 64bit windows port is now on CRAN).  You
can also manage memory more carefully.  E.g., the error indicates
there's no contiguous block of memory to hold an object of size
190.7Mb at the time the error's thrown.  That may be because all RAM
is allocated, or because of fragmentation.  R holds everything in
memory so when working w/ large objects in a restricted setting you'll
want to write unneeded objects to disc, clean up, and reload when
needed (see ?save, ?load, ?rm, and ?gc).  More info can be found at
?Memory and by Googling: R memory mangagement.  Also, for some cases
there are R packages that facilitate memory management: ff, bigmemory,
biglars, bigtabulate, biganalytics, biglm,...


Kingsford Jones

On Sun, Jul 18, 2010 at 4:14 AM, lgj200306 <lgj200306 at 163.com> wrote:
> Hi, all
>   I want to do PCNM analysis using vegan and PCNM packages,my R code as follow:
>   > bci10m=data.frame(x=rep(1:100,each=50),y=rep(1:50,times=100))
>   > bci10m.d=dist(bci10m)
>   > library(PCNM)
>   > pcnms10m.analysis1=pcnm(bci10m.d)#code 1##using function of pcnm contained in vegan package
>   > pcnms10m.analysis2=PCNM(bci10m.d) #code 2##using function of PCNM contained in PCNM package
>   > bci20m=data.frame(x=rep(1:50,each=25),y=rep(1:25,times=50))
>   > bci20m.d=dist(bci20m)
>   > pcnms20m.analysis1=pcnm(bci20m.d)#code 3
>   > pcnms20m.analysis2=PCNM(bci20m.d)#code 4
>
>
>   The result shows that code 1,3,4 are all ok, I can get what I want using these three commands. However, code4 can't be carried out. Error message shows:"cannot allocate vector of size 190.7 Mb ". I have asked a professor about this question, he told me that maybe my computer's memory was not enough and suggested me closing the calculation of Moran_I. Then I recalculated these codes using another computer that had high capability. The problem was all the same. I don't know the reason.
>   Another question, if I want to know how many pcnm eigenvectors' Moran_I are higher than expected Moran_I after using code1, how can I achive it in R?
>   Thanks for your attention!
> 2010-07-18
>
>
>
> lgj200306
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>



More information about the R-sig-ecology mailing list