[R-sig-Geo] allocate error Kenv.csr()
Roger Bivand
Roger.Bivand at nhh.no
Sun Sep 2 00:09:17 CEST 2007
On Sat, 1 Sep 2007, Marco Helbich wrote:
> Dear List,
>
> I want to calculate envelopes of Khat from simulations of csr with the
> Kenv.csr(splancs) function. My dataset contains around 300 cases. Using the
> Kenv.csr function (testing only 3 simulation runs) I got following error
> message:
>
>> UL.khat <- Kenv.csr(pts.dat, stadtreg.pol, nsim=3, s)
?Kenv.csr
The first argument, nptg: Number of points to generate in each simulation,
is not the matrix of points, just the number of points to simulate. Since
we do not know what the first value of pts.dat is, I can only guess that
it is very large, and setting the first value of the erroneous points to
17158834, I can reproduce your problem. If you set it to scalar 300,
everything will work.
Hope this helps,
Roger
PS. The warnings do say that the condition has length > 1 and only the
first element will be used in: if (npgen < nprq) { ...
where nprg is the number of points required.
> Doing simulation 1
> Fehler: kann Vektor der Größe 2.2 MB nicht allozieren
> Zusätzlich: Es gab 50 oder mehr Warnungen (Anzeige der ersten 50 mit
> warnings())
>
> Enclosed please find the output from the sessionInfo(), traceback() and
> gc():
>
>> sessionInfo()
> R version 2.5.0 (2007-04-23)
> i386-pc-mingw32
>
> locale:
> LC_COLLATE=German_Austria.1252;LC_CTYPE=German_Austria.1252;LC_MONETARY=German_Austria.1252;LC_NUMERIC=C;LC_TIME=German_Austria.1252
>
> attached base packages:
> [1] "stats" "graphics" "grDevices" "utils" "datasets" "methods"
> [7] "base"
>
> other attached packages:
> rgdal maptools foreign splancs sp
> "0.5-9" "0.6-12" "0.8-20" "2.01-22" "0.9-13"
>> traceback()
> 427: rbind(pts, genpts)
> 426: ranpts(pts, poly, nprq - npgen)
> 425: ranpts(pts, poly, nprq - npgen)
> 424: ranpts(pts, poly, nprq - npgen)
> .....
> .....
> 5: ranpts(pts, poly, nprq - npgen)
> 4: ranpts(NULL, poly, npoints)
> 3: csr(poly, nptg)
> 2: khat(csr(poly, nptg), poly, s)
> 1: Kenv.csr(pts.dat, stadtreg.pol, nsim = 3, s)
>> gc()
> used (Mb) gc trigger (Mb) max used (Mb)
> Ncells 433048 11.6 741108 19.8 661425 17.7
> Vcells 219455 1.7 52498390 400.6 62525504 477.1
>>
>
> Best regards
> Marco
> ______________________________
>
> Marco Helbich
> ISR
> Postgasse 7/4/2
> A-1010, Vienna
> Tel.: +43 (0) 699 11 71 44 02
> mail (a): marco.helbich at univie.ac.at
> mail (b): marco.helbich at gmx.at
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no
More information about the R-sig-Geo
mailing list