Sep, 22nd,2005 Dear Authors, Thanks for reading this email. I'm a graduate student from China (PRC) and learning the R at present. Now I have some questions to ask you as I have met some strange problems during installing and running the R environment, which can not be found in the "R FAQ" document (or just I can not find them). It might be useful that I gived you the information of my operation system and hardwares. I am using R on a Mandrake Linux 10.1 operation system on a PC platform parchased from IBM company. The mainboard of my computer is Intel 915PG, that means it has an integrated graphic accelerator. The first question is about the error occurs during my installation. Following the "R Installation and Administration" manual, I successully downloaded the latest version of R, unziped the file, and also completed the progress "./configure" and "make" successully. By the way, I managed to install a developmental package of Linux named "r77", which may be a FORTRAN developmental package, before installing the R environment into my computer. However, an error occured when I type the commond "make check" or "make check FORCE=FORCE" or "make check-devel", and the warnings displayed are written below:( Somewords are translated from Chinese into English by myself) "running code in 'graphics-Ex.R' ...make[4]: *** [graphics-Ex.Rout] error 1 make[4]: Leaving directory `/home/zhengqi/R_HOME/R-2.1.1/tests/Examples' make[3]: *** [test-Examples-Base] error 2 make[3]: Leaving directory `/home/zhengqi/R_HOME/R-2.1.1/tests/Examples' make[2]: *** [test-Examples] error 2 make[2]: Leaving directory `/home/zhengqi/R_HOME/R-2.1.1/tests' make[1]: *** [test-all-basics] error 1 make[1]: Leaving directory `/home/zhengqi/R_HOME/R-2.1.1/tests' make: *** [check] error 2" What's the mean of the error messeage listed up? Why it happens in my computer? Which kind of problems is it, software's or hardware's? I just ignored the mistakes, as it says in your installation manual that this kind of failures "is not necessarilly problems as they might be caused by missing functionality", until I met with the following problem. The second bug occured when I was doing some ordinary statistical work. Suppose v1 is a numerical vector of length(v1)==20; further suppose> v1 <- c(1:20).When I type the command> lines(density(v1))or> rug(v1)simillar errors take place, and it prompts the following messages below: ( some key words of the promption are translated into English by myself) For the first command, it warns: "error occurs at: plot.xy(xy.coords(x, y), type = type, col = col, lty = lty, ...) : 'plot.new' hasn't been called yet" and for the second command, it warns: "error occurs at: axis(side, at = x, lab = FALSE, lwd = lwd, ...) : 'plot.new' hasn't been called yet" Besides: warnings: some values will be clipped in: rug(v1)" These are some description of the problems I met during the installing and running the R environment. And if you need more detail description of those problems, please let me know and I will gather any information about them as much as possible. Waiting for your reply! Best wishes to everyone! Sincerely yours, Anonymous user from Beijing, China
Thank you for your detailed description. Please look at what:> capabilities()jpeg png tcltk X11 http/ftp sockets libxml fifo TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE cledit IEEE754 iconv TRUE TRUE TRUE says on your installation. If X11 is FALSE, then you need to be sure that your system has X11 development libraries installed - with X11 FALSE, graphics to screen will fail. At the Linux shell prompt (on RedHat EL3, but also using rpm packages), I see $ rpm -qa X*devel* XFree86-devel-4.3.0-95.EL Your development package may be called something else, but I think that the development package appropriate for your X11 installation is what you are missing. On Thu, 22 Sep 2005, [gb2312] ???????? wrote:> Sep, 22nd,2005 > Dear Authors, > Thanks for reading this email. I'm a graduate student from China (PRC) and learning the R at present. Now I have some questions to ask you as I have met some strange problems during installing and running the R environment, which can not be found in the "R FAQ" document (or just I can not find them). > > It might be useful that I gived you the information of my operation system and hardwares. I am using R on a Mandrake Linux 10.1 operation system on a PC platform parchased from IBM company. The mainboard of my computer is Intel 915PG, that means it has an integrated graphic accelerator. > > The first question is about the error occurs during my installation. Following the "R Installation and Administration" manual, I successully downloaded the latest version of R, unziped the file, and also completed the progress "./configure" and "make" successully. By the way, I managed to install a developmental package of Linux named "r77", which may be a FORTRAN developmental package, before installing the R environment into my computer. However, an error occured when I type the commond "make check" or "make check FORCE=FORCE" or "make check-devel", and the warnings displayed are written below:( Somewords are translated from Chinese into English by myself) > > "running code in 'graphics-Ex.R' ...make[4]: *** [graphics-Ex.Rout] error 1 > make[4]: Leaving directory `/home/zhengqi/R_HOME/R-2.1.1/tests/Examples' > make[3]: *** [test-Examples-Base] error 2 > make[3]: Leaving directory `/home/zhengqi/R_HOME/R-2.1.1/tests/Examples' > make[2]: *** [test-Examples] error 2 > make[2]: Leaving directory `/home/zhengqi/R_HOME/R-2.1.1/tests' > make[1]: *** [test-all-basics] error 1 > make[1]: Leaving directory `/home/zhengqi/R_HOME/R-2.1.1/tests' > make: *** [check] error 2" > > What's the mean of the error messeage listed up? Why it happens in my computer? Which kind of problems is it, software's or hardware's? I just ignored the mistakes, as it says in your installation manual that this kind of failures "is not necessarilly problems as they might be caused by missing functionality", until I met with the following problem. > > The second bug occured when I was doing some ordinary statistical work. Suppose v1 is a numerical vector of length(v1)==20; further suppose > > v1 <- c(1:20). > When I type the command > > lines(density(v1)) > or > > rug(v1) > simillar errors take place, and it prompts the following messages below: ( some key words of the promption are translated into English by myself) > For the first command, it warns: > "error occurs at: plot.xy(xy.coords(x, y), type = type, col = col, lty = lty, ...) : > 'plot.new' hasn't been called yet" > > and for the second command, it warns: > "error occurs at: axis(side, at = x, lab = FALSE, lwd = lwd, ...) : > 'plot.new' hasn't been called yet" > Besides: warnings: > some values will be clipped in: rug(v1)" > > These are some description of the problems I met during the installing and running the R environment. And if you need more detail description of those problems, please let me know and I will gather any information about them as much as possible. > > Waiting for your reply! > > Best wishes to everyone! > > Sincerely yours, > > Anonymous user from Beijing, China > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >-- 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
On 22-Sep-05 ???????? wrote:> Sep, > 22nd,2005 > Dear Authors, > Thanks for reading this email. I'm a graduate student from China (PRC) > and learning the R at present.Welcome! I can't respond about the error messages you got when you were installing R -- other people know more about what goes on during the 'make' phase. However:> [...] > The second bug occured when I was doing some ordinary statistical work. > Suppose v1 is a numerical vector of length(v1)==20; further suppose >> v1 <- c(1:20). > When I type the command >> lines(density(v1)) > or >> rug(v1) > simillar errors take place, and it prompts the following messages > below: ( some key words of the promption are translated into English. by myself)> For the first command, it warns: > "error occurs at: plot.xy(xy.coords(x, y), type = type, col = col, lty > = lty, ...) : > 'plot.new' hasn't been called yet" > > and for the second command, it warns: > "error occurs at: axis(side, at = x, lab = FALSE, lwd = lwd, ...) : > 'plot.new' hasn't been called yet" > Besides: warnings: > some values will be clipped in: rug(v1)"Both of these represent the same type of error. The point is that both the 'lines' and 'rug' commands *add* elements to an *existing* plot, so neither will work unless there is already a plotted graph in existence that they can add something to. So (starting in a new R session): v1<-c(1:20) lines(v1) # Error in plot.xy(xy.coords(x, y), type = type, col = col, lty = lty, # ...) : # plot.new has not been called yet However, plot(v1) lines(v1) works by adding the lines to the existing plot of points. Similarly (again starting from scratch): v1<-c(1:20) rug(v1) #Error in axis(side, at = x, lab = FALSE, lwd = lwd, ...) : # plot.new has not been called yet #In addition: Warning message: #some values will be clipped in: rug(v1) However, plot(v1) rug(v1) again works, adding the "rug" lines to the x-axis of the existing plot. In each case the underlying reason can be seen if you read carefully the opening lines of the "help" documentation for these functions, which is shown if you enter ?lines --> "Add Connected Line Segments to a Plot" and ?rug --> "Add a Rug to a Plot Description: Adds a _rug_ representation (1-d plot) of the data to the plot." The critical word in these is "Add". And you can of course throw them all in together with: plot(v1) lines(v1) rug(v1) As a person beginning to learn R, part of what one needs to learn is that the documentation, available directly with "?" and also via "help.search", usually contains the information you need though you may need to interpret the wording of the documentation carefully, even with the mind of a detective! For example, the response to "?lines" that it will "Add Connected Line Segments to a Plot" does not specify that there needs to be an existing plot. Nor will you find such a statement anywehre in the response to "?lines". Especially if one's native language is not English (though I'm sure native speakers have been caught by this as well), it might be natural to interpret this as allowing that if the plot does not already exist then it will be created in such a way as to accommodate the lines which will be added (to this imaginary "null" object"). The clue in this case is in the error message: plot.new has not been called yet which does indicate that something which needed to be done has not been done. In conjunction with the "Add" word, this could give you the idea that maybe you should "plot(v1)" first! Good luck, and best wishes, Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 094 0861 Date: 22-Sep-05 Time: 11:04:30 ------------------------------ XFMail ------------------------------
Hi, I am new to R. I have one question about outputing files in a loop; Suppose I have the following loop: for (i in 1:10) { temp = 100*2 matrix; } I want to output the value of temp into 10 files with each file containing the number of looping index (i.e, file1.csv, file2.csv, ...) without headers. How can I realize this? Thanks. James
On Sat, 2005-10-01 at 08:59 -0700, James Anderson wrote:> Hi, > I am new to R. I have one question about outputing > files in a loop; Suppose I have the following loop: > > for (i in 1:10) { > temp = 100*2 matrix; > } > I want to output the value of temp into 10 files with > each file containing the number of looping index (i.e, > file1.csv, file2.csv, ...) without headers. How can I > realize this? > Thanks. > > JamesSee ?write.table for the file creation and ?paste for creating the filenames themselves: for (i in 1:10) { temp = matrix(rnorm(200), ncol = 2) write.table(temp, file = paste("file", i, ".csv", sep = ""), row.names = FALSE, col.names = FALSE, sep = ",") } HTH, Marc Schwartz