[rkward-devel] Problem with big objects

I. Soumpasis nono.231 at gmail.com
Tue Oct 9 12:47:16 UTC 2007


2007/10/9, Thomas Friedrichsmeier <thomas.friedrichsmeier at ruhr-uni-bochum.de
>:
>
> On Sunday 07 October 2007, you wrote:
> > Yeap, there is a great difference. This solves the problem and makes it
> as
> > fast as it should. However i cannot use pdf() function with xyplot.
> > Example:
> > pdf("plot.pdf")
> > xyplot(bla bla bla)
> > dev.off()
> >
> > does not produces plots, although my data exists.
>
> You mean this is, when you run inside local()? No idea on this problem.


Yeap. The  same problem I have when I source the script file in R. If it
helps.

> Here is a very silly example showing however the problem:
>
> Thanks. Looking at it, the object browser is not quite as much to blame as
> I
> thought. Rather the time problem seems to be detection of object
> modifications (yes, ultimately, that is for the object browser). The
> problem
> in your code is that it has lots and lots of assignments inside
> the .globalenv(), and for each of these we take a note that object "m1"
> has
> changed, and should be updated after the command has finished.
>
> Compare this to this example:
>
> n=100
> m=213
> m1<-matrix(nrow=n*m, ncol=5)
> local({
>         for (i in 1:n){
>          for (j in 1:m){
>          m1[(i-1)*m+j,1]=(i-1)*j+j
>          m1[(i-1)*m+j,2]=i*j+1
>          m1[(i-1)*m+j,3]=i*j+2
>          m1[(i-1)*m+j,4]=i*j+3
>          m1[(i-1)*m+j,5]=i*j+4
>          }
>         }
>         m1 <<- m1
> })


This <<- symbol means that it makes a local variable global? Is this local
function R's or rkward's function? I tried in R and it seems to work too. In
RKWard it is really fast this way you are right. I will try to do it in my
script. I just tried the example and it is really fast.

Thanx,

Regards,
Ilias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20071009/513f754f/attachment.html>


More information about the Rkward-devel mailing list