Dear R-experts, I am running a script that has the following structure: windows(height=5.5,width=8) dat<-read.csv("myfile.csv") names(dat)<-c('a','b','c','d') dat<-dat[,1:4] xyplot(dat$a~dat$b) Then I usually save the plot as a PDF (from the menu in the R console). I can save the PDF twice in a row; but at the third time, right when I am about to give a name to the graph, R crashes, no error messages. I am using R 2.6.2, for Windows. I copy the script from TinnR. Thank you in adavance for any help, Judith ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page.
Hi Judith, If I undestand, see ?savePlot and try this xyplot(dat$a~dat$b) savePlot(filename="C:\\yourname",type=c("pdf"),device=dev.cur()) I hope this helps. Jorge On 2/20/08, Judith Flores <juryef@yahoo.com> wrote:> > Dear R-experts, > > I am running a script that has the following > structure: > > windows(height=5.5,width=8) > > dat<-read.csv("myfile.csv") > names(dat)<-c('a','b','c','d') > dat<-dat[,1:4] > > xyplot(dat$a~dat$b) > > > Then I usually save the plot as a PDF (from the > menu in the R console). I can save the PDF twice in a > row; but at the third time, right when I am about to > give a name to the graph, R crashes, no error > messages. > > I am using R 2.6.2, for Windows. I copy the script > from TinnR. > > Thank you in adavance for any help, > > Judith > > > > > ____________________________________________________________________________________ > Never miss a thing. Make Yahoo your home page. > > ______________________________________________ > R-help@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.[[alternative HTML version deleted]]
On 20/02/2008 7:44 PM, Judith Flores wrote:> Dear R-experts, > > I am running a script that has the following > structure: > > windows(height=5.5,width=8) > > dat<-read.csv("myfile.csv") > names(dat)<-c('a','b','c','d') > dat<-dat[,1:4] > > xyplot(dat$a~dat$b) > > > Then I usually save the plot as a PDF (from the > menu in the R console). I can save the PDF twice in a > row; but at the third time, right when I am about to > give a name to the graph, R crashes, no error > messages. > > I am using R 2.6.2, for Windows. I copy the script > from TinnR. > > Thank you in adavance for any help,That sounds like a bug, in R or TinnR. Can you reproduce the problem if you don't use TinnR? If so, could you send me a version of myfile.csv, and I'll see if I can reproduce it and fix it. (You might be able to reproduce it without the read.csv() call, just by creating dat with fake data, e.g. dat <- data.frame(a=1:10, b=1:10, c=1:10, d=1:10). If the bug requires TinnR, then you should probably send details to its maintainers. Duncan Murdoch
On 2/20/2008 7:44 PM, Judith Flores wrote:> Dear R-experts, > > I am running a script that has the following > structure: > > windows(height=5.5,width=8) > > dat<-read.csv("myfile.csv") > names(dat)<-c('a','b','c','d') > dat<-dat[,1:4] > > xyplot(dat$a~dat$b) > > > Then I usually save the plot as a PDF (from the > menu in the R console). I can save the PDF twice in a > row; but at the third time, right when I am about to > give a name to the graph, R crashes, no error > messages. > > I am using R 2.6.2, for Windows. I copy the script > from TinnR.I can reproduce a crash using the following code: for (i in 1:100) { windows() plot(1:100) } When R opens too many graphics windows, it is running out of memory, but not failing gracefully. It should be easy to fix. The workaround in the short term is not to accumulate open graphics windows; close them when you're done. This code runs without error: for (i in 1:100) { windows() plot(1:100) dev.off() } Duncan Murdoch