Hi all,
I've read the R for windows FAQ and am a little confused re:
memory.limit and memory.size
to start using R 2.6.2 on WinXP, 2GB RAM, I have the command line "sdi
--max-mem-size=2047M"
Once the Rgui is open, memory.limit() returns 2047, memory.size()
returns 11.315, and memory.size(max=T) returns 19.615
Shouldn't memory.size(max=T) return 2047?
Upon running several operations involving kriging (gstat package,
original data file 3 variables, 12000 observations)
the program runs out of memory
"memory.c", line 57: can't allocate memory in function m_get()
Error in predict.gstat(fit.uk, newdata = EcoSAV.grid.clip.spxdf,
debug.level = -2, :
m_get
Immediately following this,
memory.limit() returns [1] -Inf
Warning message:
In memory.limit() : no non-missing arguments
to max; returning -Inf
memory.size() returns 24.573.
memory.size(max=T) returns 46.75
To my untrained eye, it appears that R is not being allowed access to
the full memory limit specified in the cmd line....if this is the case,
how does one ensure that R is getting access to the full allotment of RAM?
Any insight is appreciated...
> sessionInfo()
R version 2.6.2 (2008-02-08)
i386-pc-mingw32
locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices datasets tcltk utils
methods base
other attached packages:
[1] maptools_0.7-7 foreign_0.8-23 gstat_0.9-43 rgdal_0.5-24
lattice_0.17-4 sp_0.9-23 svSocket_0.9-5 svIO_0.9-5
R2HTML_1.58 svMisc_0.9-5 svIDE_0.9-5
loaded via a namespace (and not attached):
[1] grid_2.6.2 tools_2.6.2
Hi all,
I've read the R for windows FAQ and am a little confused re:
memory.limit and memory.size
to start using R 2.6.2 on WinXP, 2GB RAM, I have the command line "sdi
--max-mem-size=2047M"
Once the Rgui is open, memory.limit() returns 2047, memory.size()
returns 11.315, and memory.size(max=T) returns 19.615
Shouldn't memory.size(max=T) return 2047?
Upon running several operations involving kriging (gstat package,
original data file 3 variables, 12000 observations)
the program runs out of memory
"memory.c", line 57: can't allocate memory in function m_get()
Error in predict.gstat(fit.uk, newdata = EcoSAV.grid.clip.spxdf,
debug.level = -2, :
m_get
Immediately following this,
memory.limit() returns [1] -Inf
Warning message:
In memory.limit() : no non-missing arguments
to max; returning -Inf
memory.size() returns 24.573.
memory.size(max=T) returns 46.75
To my untrained eye, it appears that R is not being allowed access to
the full memory limit specified in the cmd line....if this is the case,
how does one ensure that R is getting access to the full allotment of RAM?
Any insight is appreciated...
> sessionInfo()
R version 2.6.2 (2008-02-08)
i386-pc-mingw32
locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices datasets tcltk utils
methods base
other attached packages:
[1] maptools_0.7-7 foreign_0.8-23 gstat_0.9-43 rgdal_0.5-24
lattice_0.17-4 sp_0.9-23 svSocket_0.9-5 svIO_0.9-5
R2HTML_1.58 svMisc_0.9-5 svIDE_0.9-5
loaded via a namespace (and not attached):
[1] grid_2.6.2 tools_2.6.2
I think the clue is that the message you quote comes from gstat, which does not use R's memory allocator. It is gstat and not R that has failed to allocate memory. Try re-reading the help page for memory.size. 'max=T' does not indicate the limit (that is the job of memory.limit()), but the maximum 'used' (acquired from the OS) in that session. So 19Mb looks reasonable for R's usage. I don't understand the message from memory.limit() (and the formatting is odd). memory.limit() does not call max() (it is entirely internal), so I wonder if that really is the output from that command. (If you can reproduce it, please let us have precise reproduction instructions.) There isn't much point in increasing the memory limit from the default 1.5Gb on a 2Gb XP machine. The problem is that the user address space limit is 2Gb and fragmentation means that you are unlikely to be able to get over 1.5Gb unless you have very many small objects, in which case R will run very slowly. In any case, that is not the issue here. On Wed, 16 Apr 2008, Dave Depew wrote:> Hi all, > I've read the R for windows FAQ and am a little confused re: > memory.limit and memory.size > > to start using R 2.6.2 on WinXP, 2GB RAM, I have the command line "sdi > --max-mem-size=2047M" > Once the Rgui is open, memory.limit() returns 2047, memory.size() > returns 11.315, and memory.size(max=T) returns 19.615 > > Shouldn't memory.size(max=T) return 2047? > > Upon running several operations involving kriging (gstat package, > original data file 3 variables, 12000 observations) > the program runs out of memory > > "memory.c", line 57: can't allocate memory in function m_get() > Error in predict.gstat(fit.uk, newdata = EcoSAV.grid.clip.spxdf, > debug.level = -2, : > m_get > > Immediately following this, > > memory.limit() returns [1] -Inf > Warning message: > In memory.limit() : no non-missing arguments > to max; returning -Inf > > memory.size() returns 24.573. > > memory.size(max=T) returns 46.75 > > To my untrained eye, it appears that R is not being allowed access to > the full memory limit specified in the cmd line....if this is the case, > how does one ensure that R is getting access to the full allotment of RAM? > Any insight is appreciated... > > > > sessionInfo() > R version 2.6.2 (2008-02-08) > i386-pc-mingw32 > > locale: > LC_COLLATE=English_United States.1252;LC_CTYPE=English_United > States.1252;LC_MONETARY=English_United > States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 > > attached base packages: > [1] stats graphics grDevices datasets tcltk utils > methods base > > other attached packages: > [1] maptools_0.7-7 foreign_0.8-23 gstat_0.9-43 rgdal_0.5-24 > lattice_0.17-4 sp_0.9-23 svSocket_0.9-5 svIO_0.9-5 > R2HTML_1.58 svMisc_0.9-5 svIDE_0.9-5 > > loaded via a namespace (and not attached): > [1] grid_2.6.2 tools_2.6.2 > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Edwin,
the problem is that the underlying R code treats the "lab" argument as
something that should be approximate in some way.
In your case, you can say, e.g.:
par(lwd=3)
scatterplot3d(.....
lab= c(5,hostLength*2),
.....)
Best wishes;
uwe
Edwin Sendjaja wrote:> Hi Uwe,
>
> In your example, you have a numeric value in dataset.
>
> But my problem is that I have character value, like:uni Dortmund, uni
Berlin,
> etc.
>
>
> --------------------------------------------
> For example:
>
> Name Student Ranking
>
> 1 Uni Dortmund 100000 1
> 2. Uni Berlin 20000 3
> ...etc
>
> ---------------------------------------
>
> I want that "Name" coloumn as y-axis.
>
>
>
> ########
>
> For detail I send you as attachment my data. In that graphic you can see
that
> I want the Host-name as y-axis. But unfortunately it doesn't plot
correctly
> at the right place. Besides that, the length of y-label doesn't match
like
> what I've configured. It is strange, because I have actually
hostLength= 10.
> but in graphic:
>
peeramidion.irisa.fr-Messung-19.04.08_14.57-Timeout50-Transmission500-Europa-1-grafik-RTT_bigger_40000_3D.pdf
>
> Unfortunately, it shows only 9 Hosts.
>
-----------------------------------------------------------------------------------------------------------
>
> The Code:
>
>
> data <-
>
read.table("peeramidion.irisa.fr-Messung-TEST-50-500-Europa-1-registrar.data")
> mapping <-
read.table("Messung-TEST-50-500-Europa-1-mappingfile-PE.data")
> mergeXY<- merge(data,mapping, by.x="PE_ID",
by.y="ID")
>
> mergeXY <- subset(mergeXY, (mergeXY$Ereignis ==
"EndpointKeepAlive") &
> (mergeXY$Zusatz > 40000))
>
>
> xSet <- mergeXY$RelTime
> xTitle <- "Zeit [s]"
>
>
> ySet <- mergeXY$Host
> yTitle <- "PE-Hosts"
>
> zSet <- mergeXY$Zusatz / 1000.0
> zTitle <- "Round Trip Time [ms]"
>
>
> hostList <- levels(factor(ySet))
> hostLength <- length(hostList)
>
> pdf("RESULT.pdf", width=17, height=25, onefile=TRUE,
family="Helvetica",
> pointsize=22)
>
> par(lwd=3)
> scatterplot3d(xSet, ySet, zSet,
> xlab=xTitle, ylab=yTitle, zlab=zTitle,
> axis=TRUE, tick.marks=TRUE, label.tick.marks=TRUE,
> grid=TRUE, box=TRUE, highlight.3d=TRUE,
>
> main="Round Trip Time - EndpointKeepAlive",
> sub="Pool Registrar: peeramidion.irisa.fr",
> color=par("col"), pch=16, type="h",
> scale.y=1, angle=40,
> mar=c(5,5,5,5), y.margin.add=7,
> font.axis=2, font.lab=2,
> lty.grid=2,
>
> y.ticklabs=hostList,
> lab= c(5,hostLength),
> lab.z=5)
>
> dev.off()
>
>
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
>
>
> I hope you can help me to solve this problem.
>
>
>
>
> Kind regards,
>
>
>
>
> Edwin
>
> Am Freitag, 18. April 2008 13:58:33 schrieb Uwe Ligges:
>> Edwin Sendjaja wrote:
>>> Hi Uwe,
>>>
>>> I decided to use scatterplot3d, because it looks better.
>>> I have some questions:
>>>
>>> Is it possible to get 1 axis( for example: z-axis) not as numeric,
but as
>>> character.
>>>
>>> Because I have date set like this:
>>>
>>> x=relative Time: 0,3 ms; 0,5ms, etc
>>> y=Delay:10 ms, 20 ms, etc
>>> z= Host: cnn.com, heise.de,etc
>> See ?scatterplot3d. You can use arguments x.ticklabs, y.ticklabs,
>> z.ticklabs in order top specify character strings.
>>
>>> If no, can you tell me little how to modify the code to get this.
Thank
>>> you.
>>>
>>> another question:
>>>
>>> How can I change the width line of the axis (x,y,z). The default
line is
>>> for me too thin.
>> par(lwd=2) or more, for example.
>>
>>
>> First example from ?scatterplot3d but with some other labels on x axis
>> and thick lines:
>>
>> z <- seq(-10, 10, 0.01)
>> x <- cos(z)
>> y <- sin(z)
>> par(lwd=3)
>> scatterplot3d(x, y, z, highlight.3d=TRUE, col.axis="blue",
>> col.grid="lightblue", main="scatterplot3d -
1", pch=20,
>> x.ticklabs=paste(seq(0.3, 1.1, by=0.2), "ms"),
>> xlab="relative Time")
>>
>> Best wishes,
>> Uwe
>>
>>> Thank you in advance,
>>>
>>>
>>> Edwin Sendjaja
>>>
>>> Am Donnerstag, 17. April 2008 14:43:39 schrieb Uwe Ligges:
>>>> Edwin Sendjaja wrote:
>>>>> Hi Uwe,
>>>>>
>>>>> Thanks for your answer.
>>>>>
>>>>> What is the different between rgl and scatterplot3d? I dont
need a
>>>>> graphik like vulcano. I just need 3D-"dot"-plot.
>>>> Sure, rgl can do it as well.
>>>> Difference is that scatterplot3d is based on R's standard
devices while
>>>> rgl is based on an OpenGL device. Hence rgl is much more
flexible and
>>>> can rotate things and easily draws nice transparent forms, but
>>>> scatterplot3d is nice for printing to 2D in different formats
at the
>>>> end.
>>>>
>>>> Uwe
>>>>
>>>>> Am Donnerstag, 17. April 2008 09:03:17 schrieb Uwe Ligges:
>>>>>> Edwin Sendjaja wrote:
>>>>>>> Hello,
>>>>>>>
>>>>>>> I've got some problems. I hope someone can help
me.
>>>>>>>
>>>>>>> First question:
>>>>>>> I am trying to get grid on scatterplot3d (from
scatterplot3d
>>>>>>> package). It seems that scatterplot3d draw on grip
on X and Z side.
>>>>>>> Is it possible to get Grid on the whole Box?
>>>>>> At least there is no build in function to do it.
>>>>>>
>>>>>>> Second question:
>>>>>>> Is it possible to use the standard package drawing
3d-plot(without
>>>>>>> scatterplot3d) ?because now I have already 2d-plot.
I just want to
>>>>>>> add the z-axis.
>>>>>> See, for example, ?cloud in package
"lattice", ?plot3d in package
>>>>>> "rgl",
>>>>>>
>>>>>>> Third question:
>>>>>>> What is the best 3d-plot? it seems that
scatterplot3 doesn't support
>>>>>>> anything( like turning the box vertically. I think,
angle parameter
>>>>>>> just turn the box horisontally. I might wrong with
this.
>>>>>> You are right.
>>>>>>
>>>>>> Best wishes,
>>>>>> Uwe
>>>>>>
>>>>>>> Thank a lot in advance
>>>>>>>
>>>>>>> Edwin
>>>>>>>
>>>>>>> ______________________________________________
>>>>>>> R-help at r-project.org mailing list
>>>>>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>>>>>> PLEASE do read the posting guide
>>>>>>> http://www.R-project.org/posting-guide.html and
provide commented,
>>>>>>> minimal, self-contained, reproducible code.
>>>>>> ______________________________________________
>>>>>> R-help at r-project.org mailing list
>>>>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>>>>> PLEASE do read the posting guide
>>>>>> http://www.R-project.org/posting-guide.html and provide
commented,
>>>>>> minimal, self-contained, reproducible code.
>>>>> ______________________________________________
>>>>> R-help at r-project.org mailing list
>>>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>>>> PLEASE do read the posting guide
>>>>> http://www.R-project.org/posting-guide.html and provide
commented,
>>>>> minimal, self-contained, reproducible code.
>>>> ______________________________________________
>>>> R-help at r-project.org mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>>> PLEASE do read the posting guide
>>>> http://www.R-project.org/posting-guide.html and provide
commented,
>>>> minimal, self-contained, reproducible code.