Re: [R] R on Windows Hangs on Packages Built from Sources
It must be frustrating, but - that setup does work for other people - I don't think we have ever seen a `hang' of that sort. I would try one of the packages on CRAN which does have a recent binary compiled. (I tend to use ash to test, as it is small and uses Fortran.) If that fails then you need a way to debug the `hang' (and you haven't told us exactly where it is, so I can't suggest any). On Wed, 5 May 2004, James Chapman wrote: Hi, I am currently having the following problem with R 1.9.0. Any package that contains C or Fortran code hangs after I have built it and load it into R. I've tried this with RMySQL and udunits, originally I thought I had done something subtly wrong in configuring these packages; but I just had the same problem with a simple example R package that I wrote. I was able to build and load the package on a Linux system at school so I figure I've, hopefully, ruled out a programming problem on my part. The system I'm having the problem on is as follows: AMD AthlonXP R 1.9.0 installed from binaries GCC 3.3.1 Just checking -- gcc 3.3.3 for MinGW as in [c:/R/rw2000/src/gnuwin32]% gcc --version gcc (GCC) 3.3.1 (mingw special 20030804-1) ? Someone sent me several messages recently, and it transpired was trying to use the cygwin compilers. -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] Repeated measures regression
Why not start with: @Book{Pin:00a, author = {Pinheiro, Jose C and Bates, Douglas M}, title ={Mixed-Effects Models in {S} and {S}-{P}{L}{U}{S}}, publisher ={Springer}, year = {2000}, address = {New York} } Regards, Lorenz -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of knussear Sent: Wednesday, May 05, 2004 5:59 AM To: [EMAIL PROTECTED] Subject: [R] Repeated measures regression Hi List, Just wondering if there is such a thing as repeated measures regression, and if so, can R do it? I have repeated measurements of 10 individuals over a 45 day period, and I would like to regress their daily activity time against a daily environmental temperature. If I do so using averages of activity time I find a significant negative correlation, but I worry that because I have used the same 10 individuals for each daily mean that the daily averages are not independent. Can anyone help? Thanks Kenneth E. Nussear Phone 775 784-4565 Biological Resources FAX 775 784-1369 Research Center/315 [EMAIL PROTECTED] Reno, Nevada 89557http://www.brrc.unr.edu/~knussear/ __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] increasing memory
The commands do matter. Both ?read.table and the Data Import/Export Manual tell you ways to speed up reading a table. However, there seems to be a problem with either MacOS X or perhaps your hardware that is probably impossible to diagnose remotely. A Unix system should be able to kill any process you own with kill -9 (unless it is out of other resources, e.g. processes to run kill): that's not an R issue. On Tue, 4 May 2004, Janet Rosenbaum wrote: If it actually crashes there is a bug, but I suspect that it stops with an error message -- please do read the posting guide and tell us exactly what happens. Sorry, I hadn't realized that crash means to give an error message on this mailing list. To me, crash means that the computer freezes entirely, or if I'm lucky it just runs for several hours without doing anything, and the process can't even be killed with -9, and the computer can't be shutdown, but has to be powercycled. For instance, I left it doing a read.table on a text format file from this data (a few hundred megs) and eight hours later it was still going. I watched the process with top for awhile and the computer had plenty of free memory -- over 100 M this whole time, and R was using almost no CPU. It may still have been swapping. I have tried all sorts of ways of reading in the data. It's best if I can read the xport file since that has all the original labels which don't get to the text file, but read.xport actually freezes the computer. As I said, I am running R 1.8.1 which claims to be the most recent version (when I type is.RAqua.updated()) on an ibook G3/800 with 620 M RAM (the maximum) running 10.3.3. The command really doesn't much matter. These are totally normal files and I can load in the normal sized files with the exact same commands. w-read.table(pedagogue.csv,header=T, sep=,) library(foreign) w-read.xport(demagogue.xpt) The xpt files are up to 400 M, and the csv files are about 100 M. Janet -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] anyone know how to combine two vector with some # overlaped?
Mike wrote: Hi, there, Suppose I have two vector say x=c(1 2 3 4 5) and y=(2 3 6 7). Then I want to combine these two vector together and get z=c(1 2 3 4 5 6 7) with 2 and 3 only appear once. I want to extend this one to a general case(say more than 100 elements in x and y and each time I don't know which elements are the same). Do you happen to know how to do this and which command should use? Thank you very much. Please reply to this email. Any kind help would be greatly appreciated. Mike __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html See ?unique Uwe Ligges __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Problems in plot
Duncan Murdoch [EMAIL PROTECTED] writes: I've removed the test for the size of the frame in the case where the frame is minimized. Now for a minimized R it just uses the physical size of the monitor, as before: likely giving a window that's too big, but at least not causing errors. It would be better if you could get a hold of the unminimized size (as opposed to the maximized one). Isn't there a way to do that on Windows? -p -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] anyone know how to combine two vector with some # overlaped?
Mike wrote: Hi, there, Suppose I have two vector say x=c(1 2 3 4 5) and y=(2 3 6 7). Then I want to combine these two vector together and get z=c(1 2 3 4 5 6 7) with 2 and 3 only appear once. union(x,y) R provides several set operators. See ?union. Christophe Pallier __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Problems in plot
On 5 May 2004, Peter Dalgaard wrote: Duncan Murdoch [EMAIL PROTECTED] writes: I've removed the test for the size of the frame in the case where the frame is minimized. Now for a minimized R it just uses the physical size of the monitor, as before: likely giving a window that's too big, but at least not causing errors. It would be better if you could get a hold of the unminimized size (as opposed to the maximized one). Isn't there a way to do that on Windows? The GetWindowPlacement function retrieves the minimized, maximized, and restored positions for the window, and also determines the window's show state. apparently. `restored' seems to be the key word here. -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] anyone know how to combine two vector with some # overlaped?
If you want this: Suppose I have two vector say x=c(1 2 3 4 5) and y=(2 3 6 7). Then I want to combine these two vector together and get z=c(1 2 3 4 5 6 7) with 2 and 3 only appear once. Julian Taylor [EMAIL PROTECTED] suggests: x - c(1,2,3,4,5) y - c(2,3,6,7) z - c(x,y)[!duplicated(c(x,y))] But you can do it in one step: z - unique(c(x,y)) I don't know how unique() is implemented, but using a hash table it _could_ be done in linear expected time, and in practice it seems to be pretty quick, more than quick enough for a few hundred elements. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Graphic size with X11 device
Hello, I have done a script that make multiple graphics : one graphic per columns of my data matrix and one x11 window every 4 graphcis. For example, if my matrix has 6 columns, there will appears one x11 window with 4 graphics and a second one with the last 2 graphics. I wanted that all graphics have the same size so when I open x11 I specify width and height proportional to the number of lines expected by window. But in the second windows it is always different in size of the graphics, in size of the points and in size of the text. What do i miss? Thanks. Laetitia. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] anyone know how to combine two vector with some # overlaped?
On Wed, 5 May 2004, Richard A. O'Keefe wrote: If you want this: Suppose I have two vector say x=c(1 2 3 4 5) and y=(2 3 6 7). Then I want to combine these two vector together and get z=c(1 2 3 4 5 6 7) with 2 and 3 only appear once. Julian Taylor [EMAIL PROTECTED] suggests: x - c(1,2,3,4,5) y - c(2,3,6,7) z - c(x,y)[!duplicated(c(x,y))] But you can do it in one step: z - unique(c(x,y)) I don't know how unique() is implemented, but using a hash table it _could_ be done in linear expected time, and in practice it seems to be pretty quick, more than quick enough for a few hundred elements. It does use a hash table (as does duplicated). An slightly shorter step is union(x, y), which is implemented as unique(c(x,y)). -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Graphic size with X11 device
Are you using par(mfrow)? If so, that changes the base cex for layouts with 2 or more rows and columns. Otherwise, the text size should be the same, but in calculating the window size you have to compute the device not plot region, that is included the margins (and outer margins) which are of fixed size. I would use par(mfrow=c(2,2)) on all windows, and accept that there will be white space on the last one. On Wed, 5 May 2004, Laetitia Marisa wrote: I have done a script that make multiple graphics : one graphic per columns of my data matrix and one x11 window every 4 graphcis. For example, if my matrix has 6 columns, there will appears one x11 window with 4 graphics and a second one with the last 2 graphics. I wanted that all graphics have the same size so when I open x11 I specify width and height proportional to the number of lines expected by window. But in the second windows it is always different in size of the graphics, in size of the points and in size of the text. What do i miss? -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Discontinuities in a simple graph (machine precision?)
Hi, I've got an ugly but fairly simple function: mdevstdev - function(a){ l - dnorm(a)/(1-pnorm(a)) integrand - function(z)(abs(z-l)*dnorm(z)) inted - integrate(integrand, a, Inf) inted[[1]]/((1- pnorm(a))*sqrt((1 + a*l - l^2))) } I wanted to quickly produce a graph of this over the range [-3,3] so I used: plotit -function(x=seq(-3,3,0.01),...){ y-sapply(x,mdevstdev) plot(x,y,...) } plotit() This produces the graph, but some discontinuities appear on it. I've produced the same graph in Mathematica 5 (http://econserv2.bess.tcd.ie/cullens/R/DOverDelta.eps), and it was smooth over this range (it takes ages to run, though). Is this a numerical precision problem? Any suggestions on how to improve the precision? I'm running R 1.9 on WinXP, PIII. I haven't changed any R parameters that I know of. -- SC Simon Cullen Room 3030 Dept. Of Economics Trinity College Dublin Ph. (608)3477 Email [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Using integrate (was Discontinuities in a simple graph (machine precision?))
Note, this is about integrate, nothing else. You are looking for an answer with high absolute precision for larger a because of your divisor (about 1e-3). If I add rel.tol=1e-12 it is fine. On Wed, 5 May 2004, Simon Cullen wrote: Hi, I've got an ugly but fairly simple function: mdevstdev - function(a){ l - dnorm(a)/(1-pnorm(a)) integrand - function(z)(abs(z-l)*dnorm(z)) inted - integrate(integrand, a, Inf) inted[[1]]/((1- pnorm(a))*sqrt((1 + a*l - l^2))) } I wanted to quickly produce a graph of this over the range [-3,3] so I used: plotit -function(x=seq(-3,3,0.01),...){ y-sapply(x,mdevstdev) plot(x,y,...) } plotit() This produces the graph, but some discontinuities appear on it. I've produced the same graph in Mathematica 5 (http://econserv2.bess.tcd.ie/cullens/R/DOverDelta.eps), and it was smooth over this range (it takes ages to run, though). Is this a numerical precision problem? Any suggestions on how to improve the precision? I'm running R 1.9 on WinXP, PIII. I haven't changed any R parameters that I know of. -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Logit Deriv
__ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Discontinuities in a simple graph (machine precision?)
Simon Cullen [EMAIL PROTECTED] writes: Hi, I've got an ugly but fairly simple function: mdevstdev - function(a){ l - dnorm(a)/(1-pnorm(a)) integrand - function(z)(abs(z-l)*dnorm(z)) inted - integrate(integrand, a, Inf) inted[[1]]/((1- pnorm(a))*sqrt((1 + a*l - l^2))) } I wanted to quickly produce a graph of this over the range [-3,3] so I used: plotit -function(x=seq(-3,3,0.01),...){ y-sapply(x,mdevstdev) plot(x,y,...) } plotit() This produces the graph, but some discontinuities appear on it. I've produced the same graph in Mathematica 5 (http://econserv2.bess.tcd.ie/cullens/R/DOverDelta.eps), and it was smooth over this range (it takes ages to run, though). Is this a numerical precision problem? Any suggestions on how to improve the precision? I'm running R 1.9 on WinXP, PIII. I haven't changed any R parameters that I know of. This is probably related to integrating a non-smooth function across the singularity. It works better like this: mdevstdev function(a){ l - dnorm(a)/(1-pnorm(a)) integrand - function(z)(abs(z-l)*dnorm(z)) inted - if (l a) integrate(integrand, a, Inf)[[1]] else integrate(integrand, a, l)[[1]] + integrate(integrand, l, Inf)[[1]] inted/((1- pnorm(a))*sqrt((1 + a*l - l^2))) } (as you see, I was too lazy to think about whether l = a always...) -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Discontinuities in a simple graph (machine precision?)
Simon Cullen wrote: Hi, I've got an ugly but fairly simple function: mdevstdev - function(a){ l - dnorm(a)/(1-pnorm(a)) integrand - function(z)(abs(z-l)*dnorm(z)) inted - integrate(integrand, a, Inf) It's a matter of numerical accuracy, you might want to use, e.g.: inted - integrate(integrand, a, Inf, rel.tol = .Machine$double.eps^0.5) Uwe Ligges inted[[1]]/((1- pnorm(a))*sqrt((1 + a*l - l^2))) } I wanted to quickly produce a graph of this over the range [-3,3] so I used: plotit -function(x=seq(-3,3,0.01),...){ y-sapply(x,mdevstdev) plot(x,y,...) } plotit() This produces the graph, but some discontinuities appear on it. I've produced the same graph in Mathematica 5 (http://econserv2.bess.tcd.ie/cullens/R/DOverDelta.eps), and it was smooth over this range (it takes ages to run, though). Is this a numerical precision problem? Any suggestions on how to improve the precision? I'm running R 1.9 on WinXP, PIII. I haven't changed any R parameters that I know of. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] reading data
Hello, I´m trying to read data from a text file but i can´t When i print: a-read.table(file=C:/dados10.txt) The next error appears: Error in file(file, r) : unable to open connection In addition: Warning message: cannot open file `C:/dados10.txt' Can you help me? Margarida PS:The operating sistem i´m using is Unix __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] reading data
Unix does not file paths like C:/dados10.txt. It's an issue with your local environment, so please ask your local advisors. On Wed, 5 May 2004, Margarida Júlia Rodrigues Igreja wrote: Hello, I´m trying to read data from a text file but i can´t When i print: a-read.table(file=C:/dados10.txt) The next error appears: Error in file(file, r) : unable to open connection In addition: Warning message: cannot open file `C:/dados10.txt' Can you help me? Margarida PS:The operating sistem i´m using is Unix -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] (no subject)
Hello: I have already found references optim , but I do not understand its means !! So I want to ask next question I have a question in Math. If we want to get X's and Y's solution, X0 and Y0 We have two equation : 2*exp(X)+X^2+3*Y=2*exp(1)+4 3*exp(X/Y)+3*X*Y+4*Y=3*exp(1)+7 How I use R-project to solve above question?? THANKS YOU THANK YOU VERY MUCH!! HLC [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] ONE QUESTION IN R-PROJECT
Hello: I have already found references optim , but I do not understand its means !! So I want to ask next question I have a question in Math. If we want to get X's and Y's solution, X0 and Y0 We have two equation : 2*exp(X)+X^2+3*Y=2*exp(1)+4 3*exp(X/Y)+3*X*Y+4*Y=3*exp(1)+7 How I use R-project to solve above question?? THANKS YOU THANK YOU VERY MUCH!! HLC [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] reading data
(Reply to Margarida Júlia Rodrigues Igreja) Hello! When i print: a-read.table(file=C:/dados10.txt) The next error appears: Error in file(file, r) : unable to open connection In addition: Warning message: cannot open file `C:/dados10.txt' Can you help me? Contrary to what Professor Ripley wrote, this file name is of course totally valid under unixoid systems. But 'C:' looks like a windows hard drive mounted under a Unix directory named 'C:'. Usually this is done directly under '/', so just try: a-read.table(file=/C:/dados10.txt) -cl -- Christoph Lange MPI fuer biologische Kybernetik |Phone: +49-7071-601-607| Postfach 2169, D-72012 Tuebingen |FAX: +49-7071-601-616| __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] reading data
Just one small remark: why don´t you try (C:\\dados10.txt) ? It seems to me that the double \\ is important! Cheers Chris Christoph Lange wrote: (Reply to Margarida Júlia Rodrigues Igreja) Hello! When i print: a-read.table(file=C:/dados10.txt) The next error appears: Error in file(file, r) : unable to open connection In addition: Warning message: cannot open file `C:/dados10.txt' Can you help me? Contrary to what Professor Ripley wrote, this file name is of course totally valid under unixoid systems. But 'C:' looks like a windows hard drive mounted under a Unix directory named 'C:'. Usually this is done directly under '/', so just try: a-read.table(file=/C:/dados10.txt) -cl __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Item Similarity in Scale Analysis?
Does anyone know about R code for the methods presented in Item Similarity in Scale Analysis in Political Analysis, 2000, 8:3, 261-283 by Marco R. Steenbergen? (seems to be a variant of Item Similarity Index from Hunter 1973 (Methods for Reordering the Correltation Matrix to Facilitate Visual Inspection and Preliminary Cluster Analysis, Journal of Educational Measurement 10:51-61) which replaces guessing single item reliabilities by assumption of equal item reliabilites. Does anyone has experience with this method? SEM experts? Thanks for any help. Jens Oehlschlägel -- Sie haben neue Mails! - Die GMX Toolbar informiert Sie beim Surfen! Jetzt aktivieren unter http://www.gmx.net/info __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] dataset.date, date of an object
Ok, I'd like the date an object was saved. Here's what I used to do in S-PLUS: dataset.date('my.dataframe') [1] Tue May 4 10:16:00 2004 Prof Brian Ripley [EMAIL PROTECTED] wrote: What do you mean by `a permanently stored version of a dataset'? If you mean a save()d version, use file.info() on the saved file. R does not store objects `permanently' as S-PLUS (sic) does, so your exact phrasing is meaningless. On Tue, 4 May 2004, Jason Watts wrote: I'm looking for a function that returns the time at which a permanently stored version of a dataset (object) was last modified, just like dataset.date in S-Plus. Any suggestions? -- Brian D. Ripley, [EMAIL PROTECTED] 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 - [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] ONE QUESTION IN R-PROJECT
You've been answered a few days ago when you asked (almost?) the same question. Now you've sent it *again* and even twice to the mailing list. How can we know that you are not just a student who is too lazy to do his/her homework? ßõÊ == ßõÊ [EMAIL PROTECTED] on Wed, 5 May 2004 18:51:41 +0800 writes: ßõÊ Hello: ßõÊ I have already found references optim , ßõÊ but I do not understand its means !! ßõÊ So I want to ask next question ßõÊ I have a question in Math. ßõÊ If we want to get X's and Y's solution, X0 and Y0 ßõÊ We have two equation : ßõÊ 2*exp(X)+X^2+3*Y=2*exp(1)+4 ßõÊ 3*exp(X/Y)+3*X*Y+4*Y=3*exp(1)+7 ßõÊ How I use R-project to solve above question?? it looks like you really try to misuse the R-project (namely its community of volunteers) instead of using R -- for which you need to spend some time learning the language, functionality, graphics, etc. do read the posting guide AND some of its links, mentioned at the end of every R-help message. Regards, Martin __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] dataset.date, date of an object
Let me repeat R does not store objects `permanently' as S-PLUS (sic) does, so your exact phrasing is meaningless. In S-PLUS my.dataframe is an object in a .Data directory. There is no such concept in R. On Wed, 5 May 2004, Jason Watts wrote: Ok, I'd like the date an object was saved. Here's what I used to do in S-PLUS: dataset.date('my.dataframe') [1] Tue May 4 10:16:00 2004 Prof Brian Ripley [EMAIL PROTECTED] wrote: What do you mean by `a permanently stored version of a dataset'? If you mean a save()d version, use file.info() on the saved file. R does not store objects `permanently' as S-PLUS (sic) does, so your exact phrasing is meaningless. On Tue, 4 May 2004, Jason Watts wrote: I'm looking for a function that returns the time at which a permanently stored version of a dataset (object) was last modified, just like dataset.date in S-Plus. Any suggestions? -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Lme4 error
What's happening? Celpe.Mixed - lme(Nota~Tarefa + Corretor %in% Tarefa,random=~1|ID,data=Celpe.Dados11) Error in EMsteps-(`*tmp*`, value = controlvals) : error code 6 from Lapack routine dtrtri I've trying to fit a Mixed model using lme from package lme4 and the error above has occourred. What Should I Do to solve this? Best regards []s Leonard Assis Estatístico / CONFE 7439 UIN : 41-764-523 / Skype : lmassis / msn : [EMAIL PROTECTED] [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] increasing memory
Just a note, R 1.9.0 is the most recent version. It sounds like your computer might just be running out of memory and thrashing. 620MB of RAM is unfortunately not an enormous amount of RAM with which to be using R. These are the trade offs. If you can't read in your table using scan() then we may be running out of R options. -roger Janet Rosenbaum wrote: If it actually crashes there is a bug, but I suspect that it stops with an error message -- please do read the posting guide and tell us exactly what happens. Sorry, I hadn't realized that crash means to give an error message on this mailing list. To me, crash means that the computer freezes entirely, or if I'm lucky it just runs for several hours without doing anything, and the process can't even be killed with -9, and the computer can't be shutdown, but has to be powercycled. For instance, I left it doing a read.table on a text format file from this data (a few hundred megs) and eight hours later it was still going. I watched the process with top for awhile and the computer had plenty of free memory -- over 100 M this whole time, and R was using almost no CPU. I have tried all sorts of ways of reading in the data. It's best if I can read the xport file since that has all the original labels which don't get to the text file, but read.xport actually freezes the computer. As I said, I am running R 1.8.1 which claims to be the most recent version (when I type is.RAqua.updated()) on an ibook G3/800 with 620 M RAM (the maximum) running 10.3.3. The command really doesn't much matter. These are totally normal files and I can load in the normal sized files with the exact same commands. w-read.table(pedagogue.csv,header=T, sep=,) library(foreign) w-read.xport(demagogue.xpt) The xpt files are up to 400 M, and the csv files are about 100 M. Janet __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] dataset.date, date of an object
What exactly do you mean by saved? Do you mean modified? I don't think there is a way to tell when the last time an object was modified. However, if you use the save() function and save an object to a file, then you can just look at the time stamps on the file. -roger Jason Watts wrote: Ok, I'd like the date an object was saved. Here's what I used to do in S-PLUS: dataset.date('my.dataframe') [1] Tue May 4 10:16:00 2004 Prof Brian Ripley [EMAIL PROTECTED] wrote: What do you mean by `a permanently stored version of a dataset'? If you mean a save()d version, use file.info() on the saved file. R does not store objects `permanently' as S-PLUS (sic) does, so your exact phrasing is meaningless. On Tue, 4 May 2004, Jason Watts wrote: I'm looking for a function that returns the time at which a permanently stored version of a dataset (object) was last modified, just like dataset.date in S-Plus. Any suggestions? __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] dataset.date, date of an object
Jason Watts jcwatts999 at yahoo.com writes: I'm looking for a function that returns the time at which a permanently stored version of a dataset (object) was last modified, just like dataset.date in S-Plus. Any suggestions? I think others have already answered this (i.e. R does not store objects in files so you can't get the dates of those files); however, if its only specific objects whose dates you need and you are willing to set them yourself you could do something like this: # create object and set timestamp in an attribute df - data.frame(a=1:5,b=letters[1:5]) attr(df,timestamp) - Sys.time() # ... # update object and timestamp df$a - df$a+1 attr(df,timestamp) - Sys.time() # ... # show last modified time attr(df,timetamp) You could get much fancier by creating a class which automatically appends and updates timestamps whenever an operation is performed on its objects. That would be even easier to use but it would be more work to set up initially. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] sampling with weights
Hello, I am trying to produce an example of weighted sampling vs uniform sampling, the subject is estimation of the size distribution by sampling from a micrograph with a graticule of points. The sampling obtained is thus area weighted. I created a distribution by pop - rexp(1000)+rexp(1000)+rexp(1000) Now an uniform random sample is index - floor(1000*runif(100))+1 samp1 - pop[index] and the histograms of pop and samp1 are very similar as expected, Now to simulate a sample obtained by point counting method I did cupop - cumsum(pop) popmax - cupop[1000] index - popmax * runif(100) samp2 - rep(0,100) now for each value in index I have to find the last point in cupop that is less than , then the next one is the chosen for( i in 1:100) { xi - which(cupop index[i]) samp2[i] - pop[xi[length(xi)]+1] } Q: is there a more elegant and general way to do this sampling? As it is it works but look clumsy Thanks Heberto Ghezzo Ph.D. Meakins-Christie Labs McGill University Montreal - Canada __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Analysis of ordinal categorical data
Hi I would like to analyse an ordinal categorical variable. I know how I can analyse a nominal categorical variable (with multinom or if there are only two levels with glm). Does somebody know which command I need in R to analyse an ordinal categorical variable? I want to describe the variable y with the variables x1,x2,x3 and x4. So my model looks like: y ~ x1+x2+x3+x4. y: ordinal factor variable with levels (never, rare, bychance, often). Thanks a lot in advance Thomas __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] increasing memory
From: Roger D. Peng Just a note, R 1.9.0 is the most recent version. It sounds like your computer might just be running out of memory and thrashing. 620MB of RAM is unfortunately not an enormous amount of RAM with which to be using R. These are the trade offs. If you can't read in your table using scan() then we may be running out of R options. `Easy' ones anyway. One can always use `lower level' things like connections and readLines() to read in chunks at a time... BTW (for Janet) `crash' and `freeze' aren't exactly the same (at least to me). To me `crash' is something like segfaults, or if the program abruptly exits, or BSOD, etc. If you still can run top, then the computer hasn't really frozen, either. I suspect the reason you can't kill the program is that the computer is running _really_ low on memory and thrashing, thus not really responding to `kill' in a timely manner. I have gotten into that situation on a Linux box (w/ 2GB RAM), and can't even log in as root to try the `kill'. Similarly, the only option was to hit that big red (or maybe not so `big' or `red') button... We do need accurate descriptions of what happened to be able to be more helpful, including some basic descriptions of the data file (e.g., how many rows/columns, delimiters, column types, etc.) Andy -roger Janet Rosenbaum wrote: If it actually crashes there is a bug, but I suspect that it stops with an error message -- please do read the posting guide and tell us exactly what happens. Sorry, I hadn't realized that crash means to give an error message on this mailing list. To me, crash means that the computer freezes entirely, or if I'm lucky it just runs for several hours without doing anything, and the process can't even be killed with -9, and the computer can't be shutdown, but has to be powercycled. For instance, I left it doing a read.table on a text format file from this data (a few hundred megs) and eight hours later it was still going. I watched the process with top for awhile and the computer had plenty of free memory -- over 100 M this whole time, and R was using almost no CPU. I have tried all sorts of ways of reading in the data. It's best if I can read the xport file since that has all the original labels which don't get to the text file, but read.xport actually freezes the computer. As I said, I am running R 1.8.1 which claims to be the most recent version (when I type is.RAqua.updated()) on an ibook G3/800 with 620 M RAM (the maximum) running 10.3.3. The command really doesn't much matter. These are totally normal files and I can load in the normal sized files with the exact same commands. w-read.table(pedagogue.csv,header=T, sep=,) library(foreign) w-read.xport(demagogue.xpt) The xpt files are up to 400 M, and the csv files are about 100 M. Janet __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Notice: This e-mail message, together with any attachments,...{{dropped}} __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] externals controls normalization
I'm tryng to use loess normalization function based on externals controls (like MSP) as in Yang et al.; 2002 paper. I work with bioconductor marrayNorm package. I identified my controls in the maControls structure of marrayLayout as a vector of 0 and 1. Is someone still use it ? for the moment I just have ... test - maNormMain(manip.raw, f.loc = list(maNormLoess(x=maA, y=maM, z=maControls,subset=TRUE))) but answer is Error in simpleLoess(y, x, w, span, degree, parametric, drop.square, normalize, : invalid `x' [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Problems in plot
On 05 May 2004 09:12:59 +0200, Peter Dalgaard [EMAIL PROTECTED] wrote : Duncan Murdoch [EMAIL PROTECTED] writes: I've removed the test for the size of the frame in the case where the frame is minimized. Now for a minimized R it just uses the physical size of the monitor, as before: likely giving a window that's too big, but at least not causing errors. It would be better if you could get a hold of the unminimized size (as opposed to the maximized one). Isn't there a way to do that on Windows? I don't know if there is. I think the GetWindowPlacement function Brian mentioned returns what GetWindowRect would give if the window hadn't been minimized, but what we want is GetClientRect. GetWindowRect gives the outer dimensions of the window, GetClientRect gives the client area, i.e. the area where the MDI child windows are allowed to show. GetWindowRect is also too big, just not necessarily as much too big as what we're currently using (which is what pre-1.9.0 versions were using). It's possible that we could compute something like GetClientRect, but it's hard, because I think it depends on all sorts of things like font settings, etc. It doesn't really seem worth it to me. How often do people create new graphics windows while the MDI frame is minimized, anyway? Duncan Murdoch __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] Analysis of ordinal categorical data
Dear Thomas, One approach to an ordinal response variable is the proportional-odds model, implemented in the MASS package as polr(). The proportional-odds assumption may not hold, however. I hope this helps, John -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 7:45 AM To: [EMAIL PROTECTED] Subject: [R] Analysis of ordinal categorical data Hi I would like to analyse an ordinal categorical variable. I know how I can analyse a nominal categorical variable (with multinom or if there are only two levels with glm). Does somebody know which command I need in R to analyse an ordinal categorical variable? I want to describe the variable y with the variables x1,x2,x3 and x4. So my model looks like: y ~ x1+x2+x3+x4. y: ordinal factor variable with levels (never, rare, bychance, often). Thanks a lot in advance Thomas __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Analysis of ordinal categorical data
Thanks a lot for your advice. What do you mean with the proportional-odds assumption may not hold? Does this solution with polr always works? Or what's important to take into account? Regards Thomas Dear Thomas, One approach to an ordinal response variable is the proportional-odds model, implemented in the MASS package as polr(). The proportional-odds assumption may not hold, however. I hope this helps, John -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 7:45 AM To: [EMAIL PROTECTED] Subject: [R] Analysis of ordinal categorical data Hi I would like to analyse an ordinal categorical variable. I know how I can analyse a nominal categorical variable (with multinom or if there are only two levels with glm). Does somebody know which command I need in R to analyse an ordinal categorical variable? I want to describe the variable y with the variables x1,x2,x3 and x4. So my model looks like: y ~ x1+x2+x3+x4. y: ordinal factor variable with levels (never, rare, bychance, often). Thanks a lot in advance Thomas __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] Analysis of ordinal categorical data
On Wed, 5 May 2004, John Fox wrote: One approach to an ordinal response variable is the proportional-odds model, implemented in the MASS package as polr(). The proportional-odds assumption may not hold, however. And you can find out by comparing the fit with a multinom fit -- see the MASS scripts for a worked example. -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Installation on Windows XP
R never gave me any serious problems until I tried to use it on Windows XP. I had 1.8.1 installed and working successfully for a few weeks. This morning when I launched it, I received this error message: R for Windows GUI front-end has encountered a problem and needs to close. We are sorry for the inconvenience. I downloaded 1.9.0 and installed it, but when I launch it, I get this message: Fatal error: Invalid HOMEDRIVE. I would appreciate any assistance. -Dave __ David Bickel http://davidbickel.com This communication is for use by the intended recipient and ...{{dropped}} __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] Analysis of ordinal categorical data
Dear Thomas, Barring a numerical problem, polr() will fit the model as a mechanical matter, but the proportional-odds model and other, relatively parsimonious, models for ordinal data, make assumptions about the structure of the data. I don't think that it's sensible to explain the model in detail here; you could consult a text that discusses the model -- it's a standard topic in categorical-data analysis. Two sources are Venables and Ripley's Modern Applied Statistics with S (with which the MASS package is associated) and my own R and S-PLUS Companion to Applied Regression. Regards, John -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 9:29 AM To: [EMAIL PROTECTED] Subject: [R] Analysis of ordinal categorical data Thanks a lot for your advice. What do you mean with the proportional-odds assumption may not hold? Does this solution with polr always works? Or what's important to take into account? Regards Thomas Dear Thomas, One approach to an ordinal response variable is the proportional-odds model, implemented in the MASS package as polr(). The proportional-odds assumption may not hold, however. I hope this helps, John -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 7:45 AM To: [EMAIL PROTECTED] Subject: [R] Analysis of ordinal categorical data Hi I would like to analyse an ordinal categorical variable. I know how I can analyse a nominal categorical variable (with multinom or if there are only two levels with glm). Does somebody know which command I need in R to analyse an ordinal categorical variable? I want to describe the variable y with the variables x1,x2,x3 and x4. So my model looks like: y ~ x1+x2+x3+x4. y: ordinal factor variable with levels (never, rare, bychance, often). Thanks a lot in advance Thomas __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] Installation on Windows XP
David, See the message of Duncan Murdoch to another user which I have pasted next: On Mon, 26 Apr 2004 09:56:29 -0700, Brett Melbourne [EMAIL PROTECTED] wrote : Alain, I'm sure you'll find that the Windows critical update KB835732 has been installed on your machine. This is most likely the problem, not SPSS. I put up a little web page http://www.murdoch-sutherland.com/HOMEPATH.html describing this bug in KB835732. Can you let me know if your experience with it matches my description? For newcomers reading this, the symptoms are that R fails to start. In version 1.9.0 the error message is usually Fatal Error: INVALID HOMEDRIVE. The patched version of 1.9.0 can deal with the bug; the workaround in earlier ones is to put something like R_USER=c:/ on the command line that starts R. Duncan Murdoch __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -Original Message- From: Bickel, David [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 10:46 AM To: [EMAIL PROTECTED] Subject: [R] Installation on Windows XP R never gave me any serious problems until I tried to use it on Windows XP. I had 1.8.1 installed and working successfully for a few weeks. This morning when I launched it, I received this error message: R for Windows GUI front-end has encountered a problem and needs to close. We are sorry for the inconvenience. I downloaded 1.9.0 and installed it, but when I launch it, I get this message: Fatal error: Invalid HOMEDRIVE. I would appreciate any assistance. -Dave __ David Bickel http://davidbickel.com This communication is for use by the intended recipient and ...{{dropped}} __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] syntax error in function 'for'
Dear list, I get a syntax error for the following function: for(na.omit(sqrt(D))2) {na.omit(A)-(na.omit(B)+(na.omit(sqrt(C} Any idea what is wrong? I am using R 1.8.1 on Linux, Kernel 2.4.21-i686. Regards, Ulrich -- __ Ulrich Leopold MSc. Computational Bio- and Physical Geography (CBPG) Institute for Biodiversity and Ecosystem Dynamics (IBED) Faculty of Science University of Amsterdam Nieuwe Achtergracht 166 NL-1018WV Amsterdam Room: B2.52 Phone: +31 20 525 7456 (7451 Secretary) Fax:+31 20 525 7431 Mobile: +31 64 220 3028 Email: [EMAIL PROTECTED] URL:www.science.uva.nl/ibed/cbpg __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] syntax error in function 'for'
Ulrich Leopold wrote: Dear list, I get a syntax error for the following function: for(na.omit(sqrt(D))2) {na.omit(A)-(na.omit(B)+(na.omit(sqrt(C} Any idea what is wrong? I am using R 1.8.1 on Linux, Kernel 2.4.21-i686. Regards, Ulrich `na.omit(sqrt(D))2' is not of the form `var in seq' as the help page for `for' would have told you. Try help(for). --sundar __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] syntax error in function 'for'
Ulrich Leopold wrote: Dear list, I get a syntax error for the following function: for(na.omit(sqrt(D))2) {na.omit(A)-(na.omit(B)+(na.omit(sqrt(C} Any idea what is wrong? I am using R 1.8.1 on Linux, Kernel 2.4.21-i686. Regards, Ulrich have a look at help(for): Control package:base R Documentation Control Flow Description: ... Usage: if(cond) expr if(cond) cons.expr else alt.expr for(var in seq) expr ... Examples: for(i in 1:5) print(1:i) for(n in c(2,5,10,20,50)) { x - rnorm(n) cat(n,:, sum(x^2),\n) } Peter Wolf __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] syntax error in function 'for'
Ulrich Leopold [EMAIL PROTECTED] writes: Dear list, I get a syntax error for the following function: for(na.omit(sqrt(D))2) {na.omit(A)-(na.omit(B)+(na.omit(sqrt(C} Any idea what is wrong? Yes, that's not the syntax for a for loop. I have no idea what your intention might have been, though. -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] syntax error in function 'for'
On Wed, 2004-05-05 at 17:11, Peter Dalgaard wrote: Ulrich Leopold [EMAIL PROTECTED] writes: Dear list, I get a syntax error for the following function: for(na.omit(sqrt(D))2) {na.omit(A)-(na.omit(B)+(na.omit(sqrt(C} Any idea what is wrong? Yes, that's not the syntax for a for loop. I have no idea what your intention might have been, though. Ok thanks. I think I misunderstood the example in the help. I think, I rather need an if function. I would like to calculate the right hand side if the condition on the left hand side is met. I am afraid I do not quite understand the syntax. if(na.omit(sqrt(D))2) {na.omit(A)-(na.omit(B)+(na.omit(sqrt(C} Now I get the following warning: the condition has length 1 and only the first element will be used in: if(na.omit(sqrt(D))2) { -- __ Ulrich Leopold MSc. Computational Bio- and Physical Geography (CBPG) Institute for Biodiversity and Ecosystem Dynamics (IBED) Faculty of Science University of Amsterdam Nieuwe Achtergracht 166 NL-1018WV Amsterdam Room: B2.52 Phone: +31 20 525 7456 (7451 Secretary) Fax:+31 20 525 7431 Mobile: +31 64 220 3028 Email: [EMAIL PROTECTED] URL:www.science.uva.nl/ibed/cbpg __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] syntax error in function 'for'
Ulrich Leopold wrote: On Wed, 2004-05-05 at 17:11, Peter Dalgaard wrote: Ulrich Leopold [EMAIL PROTECTED] writes: Dear list, I get a syntax error for the following function: for(na.omit(sqrt(D))2) {na.omit(A)-(na.omit(B)+(na.omit(sqrt(C} Any idea what is wrong? Yes, that's not the syntax for a for loop. I have no idea what your intention might have been, though. Ok thanks. I think I misunderstood the example in the help. I think, I rather need an if function. I would like to calculate the right hand side if the condition on the left hand side is met. I am afraid I do not quite understand the syntax. if(na.omit(sqrt(D))2) {na.omit(A)-(na.omit(B)+(na.omit(sqrt(C} Now I get the following warning: the condition has length 1 and only the first element will be used in: if(na.omit(sqrt(D))2) { What is the result of the condition (1:10) 2 ? What should be done? Read the text of the warning again. Peter Wolf __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] syntax error in function 'for'
Dear Ulrich, I believe that you want ifelse(), not if(), but there are likely some other problems lurking here: You're removing missing data independently from the several vectors -- unless the NAs are all in the same places, things will not work or not work correctly. As well, what do you want to happen if the condition fails? John -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ulrich Leopold Sent: Wednesday, May 05, 2004 10:06 AM To: R-help Subject: [R] syntax error in function 'for' Dear list, I get a syntax error for the following function: for(na.omit(sqrt(D))2) {na.omit(A)-(na.omit(B)+(na.omit(sqrt(C} Any idea what is wrong? I am using R 1.8.1 on Linux, Kernel 2.4.21-i686. Regards, Ulrich -- __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Reshape of repeated measures data
Dear R-helpers, I am trying to reshape a data frame that is in a wide format into a long format one. I have come across the reshape() function, but I have been very successful using it. As an example: ll - data.frame(time.1=seq(0.1,1,length=10),L1=rnorm(10),time.2=c(seq(1,7),rep(NA ,3)),R2=c(rnorm(7),rep(NA,3)),time.3=c(seq(1,1.5,length=3)+5,rep(NA,7)),M3=c (rnorm(3),rep(NA,7))) which gives me ll time.1 L1 time.2 R2 time.3 M3 1 0.1 -0.41682731 1 -0.6734289 6.00 -1.7197765 2 0.2 0.45803536 2 -1.7629712 6.25 -0.1756395 3 0.3 0.70046943 3 1.0004967 6.50 -0.6492431 4 0.4 -0.44064572 4 -1.9410689 NA NA 5 0.5 -0.16925252 5 1.3035123 NA NA 6 0.6 -0.06501635 6 1.5709351 NA NA 7 0.7 0.50151676 7 0.1625204 NA NA 8 0.8 -0.78538134 NA NA NA NA 9 0.9 -0.08774319 NA NA NA NA 101.0 1.23420424 NA NA NA NA I have some NA data given that different subjects have different number of measures and the rate of measurements is different between subjects. I would like to have a data frame with three variables: 1) time 2) Measure 3) Subject of the form timeMeasure Subject 0.1 -0.41682731 L1 ... ... ... 6.50 -0.6492431 M3 I have tried with reshape and the closest I've got to it was, reshape(ll,idvar=Time,varying=list(names(ll)),v.names=Strain,timevar=ID ,direction=long) Could anybody give me some help? thanks in advance, Jesus -- Jesús María Frías Celayeta School of Food Sci. and Env. Health. Faculty of Tourism and Food Dublin Institute of Technology Cathal Brugha St., Dublin 1. Ireland t +353 1 4024459 f +353 1 4024495 w www.dit.ie/DIT/tourismfood/science/staff/frias.html -- -- This message has been scanned for content and viruses by the DIT Information Services MailScanner Service, and is believed to be clean. http://www.dit.ie __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Do I get some help?
Dear helper. I am a student in SFSU. I had a class that introduce a new open-source R in this semester. It's, however, hard to understand how to make R command. Especially, at this time we( including my friend) have to explain some concepts (e.g. mahalanobis distance, kolmogorov-smirnow statistics, ROC curve, Gini coefficient, and the delta approach) We have to explain these concepts based on credit scoring and we also have to show examples of each concept by using R. I did not find any dataset with which i can use. This is why i send an e-mail to you helper. I think you helpers are able to make R command. Please send me any examples you make. If you need more information, just let me know and I send all information you need. Thank you! Have a nice day! Sincerely, Bong-Jo An __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] cgi/servlets/httpd in R
Hi R-helpers Has anyone had any experience doing CGI or Servlets or using an httpd server in R? Context: we are interested in running dynamic demographic calculations on the internet (life tables, and such) in response to form submissions. I might do simple cgi to get started, but loading in data each time seems like it would be quite, quite slow. I have looked at Rserv, but I am most interested in something non-Java (once Sun goes the way of the dinosaurs, so will that silly language -- come on, flame me, I can take it!) If there is a project, I might be able to contribute to it. If there isn't, I might start one Thanks! webb __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] cgi/servlets/httpd in R
On Wednesday, May 5, 2004, at 18:09 Europe/London, foobar wrote: Hi R-helpers Has anyone had any experience doing CGI or Servlets or using an httpd server in R? yes. See the R FAQ, section 4. (Or maybe you already have, in which case I misunderstood the question...) Best wishes, David __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] heatmap for gene clustering?
I am using heatmap to cluster genes in microarrays. It works fine with 100~200 genes. But when I draw a heatmap with 600 genes, I can't read a clustering tree well. Maybe I will be able to read it by dividing it into several subtrees using a function such as subtree. I found subtree in Splus, but not in R. Is there a similar function in R? Or, without it, how can I solve this problem? HJ _ MSN Toolbar provides one-click access to Hotmail from any Web page FREE download! http://toolbar.msn.com/go/onm00200413ave/direct/01/ __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] Do I get some help?
Start R. Enter help.start() Read Introduction to R to understand the basics. Then in R enter ?help.search and understand how to use that function for finding what you need. For instance, try ?mahalanobis and review the examples at the bottom. Lutz __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Discontinuities in a simple graph (machine precision?)
Thanks to Prof. Ripley, Peter Dalgaard and Uwe Ligges for pointing out that all I needed to do to improve the precision was replace inted - integrate(integrand, a, Inf) with inted - integrate(integrand, a, Inf,rel.tol = .Machine$double.eps^0.5) Thanks for the advice! -- SC Simon Cullen Room 3030 Dept. Of Economics Trinity College Dublin Ph. (608)3477 Email [EMAIL PROTECTED] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] sample
Dear List: I have the following simple program: x- sample(site) VarGuilda1- var(tapply(x,site,func1)) VarGuilda2- var(tapply(x,site,func2)) VarGuilda3- var(tapply(x,site,func3)) VarGuilda4- var(tapply(x,site,func4)) VarGuilda5- var(tapply(x,site,func5)) VarGuilda6- var(tapply(x,site,func6)) VarGuilda7- var(tapply(x,site,func7)) VarGuilda8- var(tapply(x,site,func8)) VarGuilda9- var(tapply(x,site,func9)) Var-cbind(VarGuilda1,VarGuilda2,VarGuilda3,VarGuilda4,VarGuilda5,VarGuilda6,VarGuilda7,VarGuilda8,VarGuilda9) write(Var,file=LAU_Var_01.txt, ncol=9) Every time I want to repeat this I have to change the name of *.txt file manually. How can I automate this, so it could be done for all the *.txt files (1000) I have to generate. Thanks in advance, Rogério -- Rogério R. Silva MZUSP http://www.mz.usp.br Linux User #354364 Linux counter http://counter.li.org __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] weirdness in sourc()ing a dump() (bug?)
Hi all, I dump the result of a long simulation, which I know has run to completion and returned a fairly complex list of lists of things. However, when I try to read it back in, I get the following error: source ('../SIMULATIONS/run.1.R') Error in structure(list(do.extinction.runs, alpha = 1.8, delta.change = 0.005, : Object do.extinction.runs not found I think the offending part of my dump is: SNIP OF LOTS OF DATA call.list = structure(list(do.extinction.runs, alpha = 1.8, delta.change = 0.005, delta.bar = 0.01, extinction = seq(0.6, 0.8, 0.005)), .Names = c(, alpha, delta.change, delta.bar, extinction))), /SNIP The return statement for the simulation is: SNIP return(list (DATA=my.data, MEANS=data.frame(EXT.CUT=means[,1], MEAN=means[,2]), run.date=date(), call.list=as.list(match.call( /SNIP As you can see, I am trying to return my call parameters as a list (so I can write appropriate titles on my graphs). It works just fine when do a = do.extinction.runs(blah, blah) but not when I do: a = do.ext... dump('a', 'foo.R') source ('foo.R') Any thoughts? Seems like a bug in dump, and I would be happy to help squash it if the right person gets hold of me. Thanks much to a list that might be getting tired of me this week! W __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] sample
Rogério Rosa da Silva wrote: Dear List: I have the following simple program: x- sample(site) VarGuilda1- var(tapply(x,site,func1)) VarGuilda2- var(tapply(x,site,func2)) VarGuilda3- var(tapply(x,site,func3)) VarGuilda4- var(tapply(x,site,func4)) VarGuilda5- var(tapply(x,site,func5)) VarGuilda6- var(tapply(x,site,func6)) VarGuilda7- var(tapply(x,site,func7)) VarGuilda8- var(tapply(x,site,func8)) VarGuilda9- var(tapply(x,site,func9)) Var-cbind(VarGuilda1,VarGuilda2,VarGuilda3,VarGuilda4,VarGuilda5,VarGuilda6,VarGuilda7,VarGuilda8,VarGuilda9) write(Var,file=LAU_Var_01.txt, ncol=9) Every time I want to repeat this I have to change the name of *.txt file manually. How can I automate this, so it could be done for all the *.txt files (1000) I have to generate. Thanks in advance, Rogério Use ?paste. for(i in 1:1000) { ... file - paste(LAU_Var_, i, .txt, sep = ) write(Var, file = file, ncol = 9) } or if you want something like LAU_VAR_.txt, you can use ?sprintf: file - LAU_Var_%04d.txt for(i in 1:1000) { ... write(Var, file = sprintf(file, i), ncol = 9) } --sundar __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] weirdness in sourc()ing a dump() (bug?)
Webb Sprague [EMAIL PROTECTED] writes: return(list (DATA=my.data, MEANS=data.frame(EXT.CUT=means[,1], MEAN=means[,2]), run.date=date(), call.list=as.list(match.call( /SNIP As you can see, I am trying to return my call parameters as a list (so I can write appropriate titles on my graphs). It works just fine when do Any thoughts? Seems like a bug in dump, and I would be happy to help squash it if the right person gets hold of me. Yep, it's a bug. A minimal version is f - function()as.list(match.call()) dput(f()) list(f) dput(f(),xx) dget(xx) [[1]] function()as.list(match.call()) (or an error if you remove f first). What should happen is probably dput(f) list(as.name(f)) Similarly f - function()match.call() dput(f()) f() dput(f(),xx) rm(f) dget(xx) Error in eval(expr, envir, enclos) : couldn't find function f -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] sample
Others have pointed out `paste' for constructing the file names. What I'd like to suggest is `cleaning up' the code a bit. Assuming func1, ..., func9 all return a single number, so that each tapply() call returns a vector, you can try something like: f1 = mean f2 = median f3 = function(x) (mean(x) + median(x)) / 2 ## Put the functions into a list. flist = sapply(1:3, function(i) get(paste(f, i, sep=))) x = rnorm(20) ## generate some data g = rep(1:4, each=5)## generate groups res = apply(sapply(flist, function(f) tapply(x, g, f)), 2, var) res [1] 0.4264803 0.5438598 0.4639551 (You obviously need to work out the details to make sure this fits the data structure you have.) This is sort of taking the `whole object' approach. You can take it one step further by using replicate() instead of explicit for loop to repeat the 1000 times... Andy From: Rogério Rosa da Silva Dear List: I have the following simple program: x- sample(site) VarGuilda1- var(tapply(x,site,func1)) VarGuilda2- var(tapply(x,site,func2)) VarGuilda3- var(tapply(x,site,func3)) VarGuilda4- var(tapply(x,site,func4)) VarGuilda5- var(tapply(x,site,func5)) VarGuilda6- var(tapply(x,site,func6)) VarGuilda7- var(tapply(x,site,func7)) VarGuilda8- var(tapply(x,site,func8)) VarGuilda9- var(tapply(x,site,func9)) Var-cbind(VarGuilda1,VarGuilda2,VarGuilda3,VarGuilda4,VarGuil da5,VarGuilda6,VarGuilda7,VarGuilda8,VarGuilda9) write(Var,file=LAU_Var_01.txt, ncol=9) Every time I want to repeat this I have to change the name of *.txt file manually. How can I automate this, so it could be done for all the *.txt files (1000) I have to generate. Thanks in advance, Rogério -- Rogério R. Silva MZUSP http://www.mz.usp.br Linux User #354364 Linux counter http://counter.li.org __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] weirdness in sourc()ing a dump() (bug?)
Peter Dalgaard [EMAIL PROTECTED] writes: (or an error if you remove f first). What should happen is probably dput(f) list(as.name(f)) Erm, more likely: quote(f) -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] weirdness in sourc()ing a dump() (bug?)
I don't think it is a bug. Note that dump does not even claim to dump lists let alone symbols, but ?dump says At present the implementation of 'dump' is very incomplete and it really only works for functions and simple vectors. Given that, this is not unexpected. (Looks like more than one person did not check the help page ) I think save/load is a much safer way to handle saving R objects, and it does work in PD's example. On 5 May 2004, Peter Dalgaard wrote: Webb Sprague [EMAIL PROTECTED] writes: return(list (DATA=my.data, MEANS=data.frame(EXT.CUT=means[,1], MEAN=means[,2]), run.date=date(), call.list=as.list(match.call( /SNIP As you can see, I am trying to return my call parameters as a list (so I can write appropriate titles on my graphs). It works just fine when do Any thoughts? Seems like a bug in dump, and I would be happy to help squash it if the right person gets hold of me. Yep, it's a bug. A minimal version is f - function()as.list(match.call()) dput(f()) list(f) dput(f(),xx) dget(xx) [[1]] function()as.list(match.call()) (or an error if you remove f first). What should happen is probably dput(f) list(as.name(f)) Similarly f - function()match.call() dput(f()) f() dput(f(),xx) rm(f) dget(xx) Error in eval(expr, envir, enclos) : couldn't find function f -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] heatmap for gene clustering?
Look into ?cutree. Sean On 5/5/04 1:29 PM, Hyung Cho [EMAIL PROTECTED] wrote: I am using heatmap to cluster genes in microarrays. It works fine with 100~200 genes. But when I draw a heatmap with 600 genes, I can't read a clustering tree well. Maybe I will be able to read it by dividing it into several subtrees using a function such as subtree. I found subtree in Splus, but not in R. Is there a similar function in R? Or, without it, how can I solve this problem? HJ _ MSN Toolbar provides one-click access to Hotmail from any Web page FREE download! http://toolbar.msn.com/go/onm00200413ave/direct/01/ __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] weirdness in sourc()ing a dump() (bug?)
On Wed, 5 May 2004 20:20:51 +0100 (BST), Prof Brian Ripley [EMAIL PROTECTED] wrote : I don't think it is a bug. Note that dump does not even claim to dump lists let alone symbols, but ?dump says At present the implementation of 'dump' is very incomplete and it really only works for functions and simple vectors. Given that, this is not unexpected. (Looks like more than one person did not check the help page ) I think save/load is a much safer way to handle saving R objects, and it does work in PD's example. I'd still call it a bug, since 'dump(x); source(dumpdata.R)' could change the meaning of x without any warning, and that can't be desirable behaviour. For example, f-function (...) + { + return(list(call.list = as.list(match.call( + } x - f(y=4) x $call.list $call.list[[1]] f $call.list$y [1] 4 f - quote(g) dump(x) source(dumpdata.R) x $call.list $call.list[[1]] g $call.list$y [1] 4 If dump() can't handle certain kinds of objects, then it should signal an error, it shouldn't dump something that can't be sourced properly. Duncan Murdoch __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] weirdness in sourc()ing a dump() (bug?)
On Wed, 5 May 2004, Duncan Murdoch wrote: On Wed, 5 May 2004 20:20:51 +0100 (BST), Prof Brian Ripley [EMAIL PROTECTED] wrote : I don't think it is a bug. Note that dump does not even claim to dump lists let alone symbols, but ?dump says At present the implementation of 'dump' is very incomplete and it really only works for functions and simple vectors. Given that, this is not unexpected. (Looks like more than one person did not check the help page ) I think save/load is a much safer way to handle saving R objects, and it does work in PD's example. I'd still call it a bug, since 'dump(x); source(dumpdata.R)' could change the meaning of x without any warning, and that can't be desirable behaviour. That's not what it says it does, and not what the S version achieves either. (Do see the documentation on `what is a bug' in the FAQ, which does not agree with you.) I was trying to be constructive: save/load *is* supposed to reproduce objects, and it just not realistic to get dump/source to do that. And we do warn about it in the documentation and I can see nowhere that recommends dump/save as a way of saving objects (If there is such a place, then that is a bug and needs fixing.) -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] weirdness in sourc()ing a dump() (bug?)
On Wed, 5 May 2004 20:50:29 +0100 (BST), Prof Brian Ripley [EMAIL PROTECTED] wrote : That's not what it says it does, and not what the S version achieves either. (Do see the documentation on `what is a bug' in the FAQ, which does not agree with you.) If a command does the wrong thing, that is a bug. But be sure you know for certain what it ought to have done. This is a case where we disagree about what it ought to have done. The documentation says This function takes a vector of names of R objects and produces text representations of the objects on a file or connection. A 'dump' file can be 'source'd into another R (or S) session. The error generated in the original example contradicts this, and the incorrect value being loaded in my example contradicts the implication that when 'source'd, the value will match the original one. Later it says At present the implementation of 'dump' is very incomplete and it really only works for functions and simple vectors. Here's where we disagree about the interpretation. If I understand you correctly, you're saying that this implies that any behaviour at all for other objects would be acceptable. I'd say it's okay to have limitations on the function, but it's too much of a contradiction with the purpose of the function given in the initial description if it silently corrupts data. I was trying to be constructive: save/load *is* supposed to reproduce objects, and it just not realistic to get dump/source to do that. And we do warn about it in the documentation and I can see nowhere that recommends dump/save as a way of saving objects (If there is such a place, then that is a bug and needs fixing.) I think we're both trying to be constructive. I'm suggesting that the internal dump code should check the type of inputs, and generate an error when it gets something that it can't handle properly. Duncan Murdoch __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] weirdness in sourc()ing a dump() (bug?)
Prof Brian Ripley [EMAIL PROTECTED] writes: On Wed, 5 May 2004, Duncan Murdoch wrote: On Wed, 5 May 2004 20:20:51 +0100 (BST), Prof Brian Ripley [EMAIL PROTECTED] wrote : I don't think it is a bug. Note that dump does not even claim to dump lists let alone symbols, but ?dump says At present the implementation of 'dump' is very incomplete and it really only works for functions and simple vectors. Given that, this is not unexpected. (Looks like more than one person did not check the help page ) I think save/load is a much safer way to handle saving R objects, and it does work in PD's example. I'd still call it a bug, since 'dump(x); source(dumpdata.R)' could change the meaning of x without any warning, and that can't be desirable behaviour. That's not what it says it does, and not what the S version achieves either. (Do see the documentation on `what is a bug' in the FAQ, which does not agree with you.) Weelll.. The goal of dump/dput is to create a construct that can be evaluated so as to yield the original object. This is one place where we fail to meet that goal, so I'll call it a bug, documented or not. Especially, since it is something we might actually be able to fix fairly simply (note might -- we've had our share of fixes that didn't in the deparsing area). I was trying to be constructive: save/load *is* supposed to reproduce objects, and it just not realistic to get dump/source to do that. And we do warn about it in the documentation and I can see nowhere that recommends dump/save as a way of saving objects (If there is such a place, then that is a bug and needs fixing.) I don't disagree that save/load is a better strategy for data storage, but dump and friends do have the potential to create an *editable* text representation, so there is some point in trying to make them work predictably as far as possible. -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] GLMM with random slope
I was using GLMM to fit a model (binomial) with random slope. When I put random~1|ID I got the results (random intercept) when I put random~time|ID I got an error Thanks. Liliana __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] weirdness in sourc()ing a dump() (bug?)
Well, that has been interesting. I don't actually understand why there are separate commands for dump and save, rather than options to one single save x object to a file for later. I would agree with Peter that being able to edit (possible compex) data object would be very nice. I am forced to agree with Brian that I was remiss in reading the documentation. W __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] need help!
Dear: I just try to use the R to solve some statistic problem recently. but i found that there are no a good way to edit the data , it is not friendly to deal with data like excel when i use command edit() or fix(). i even canot copy one column data. it just let me copy one cell data. so i think probably there are some other command can solve this trouble better. it will be very help if yuo can tell me. thanks kj. _ MSN Messenger: http://messenger.msn.com/cn __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] strptime
Here's a hint: str(unclass(z)) List of 9 $ sec : int [1:5] 20 56 30 3 26 $ min : int [1:5] 3 29 3 21 56 $ hour : int [1:5] 23 22 1 18 16 $ mday : int [1:5] 27 27 14 28 1 $ mon : int [1:5] 1 1 0 1 1 $ year : int [1:5] 92 92 92 92 92 $ wday : int [1:5] 4 4 2 5 6 $ yday : int [1:5] 57 57 13 58 31 $ isdst: int [1:5] 0 0 0 0 0 Andy From: David Scott Delving into the murky world of dates and times I found this: dates - c(02/27/92, 02/27/92, 01/14/92, 02/28/92, 02/01/92) times - c(23:03:20, 22:29:56, 01:03:30, 18:21:03, 16:56:26) x - paste(dates, times) z - strptime(x, %m/%d/%y %H:%M:%S) z [1] 1992-02-27 23:03:20 1992-02-27 22:29:56 1992-01-14 01:03:30 [4] 1992-02-28 18:21:03 1992-02-01 16:56:26 which I understand. But then length(dates) [1] 5 length(times) [1] 5 length(z) [1] 9 which I don't. It seems that length of a POSIXlt vector (which z is), always returns 9. David Scott PS: Using 1.9.0 on linux _ David Scott Department of Statistics, Tamaki Campus The University of Auckland, PB 92019 AucklandNEW ZEALAND Phone: +64 9 373 7599 ext 86830 Fax: +64 9 373 7000 Email:[EMAIL PROTECTED] Graduate Officer, Department of Statistics __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] strptime
Issuing the command: unclass(z) will show what is going on here. David Scott d.scott at auckland.ac.nz writes: : : Delving into the murky world of dates and times I found this: : : dates - c(02/27/92, 02/27/92, 01/14/92, 02/28/92, 02/01/92) : times - c(23:03:20, 22:29:56, 01:03:30, 18:21:03, 16:56:26) : x - paste(dates, times) : z - strptime(x, %m/%d/%y %H:%M:%S) : z : [1] 1992-02-27 23:03:20 1992-02-27 22:29:56 1992-01-14 01:03:30 : [4] 1992-02-28 18:21:03 1992-02-01 16:56:26 : : which I understand. But then : : length(dates) : [1] 5 : length(times) : [1] 5 : length(z) : [1] 9 : : : which I don't. : : It seems that length of a POSIXlt vector (which z is), always returns 9. : : David Scott : : PS: Using 1.9.0 on linux : : : _ : David Scott Department of Statistics, Tamaki Campus : The University of Auckland, PB 92019 : AucklandNEW ZEALAND : Phone: +64 9 373 7599 ext 86830 Fax: +64 9 373 7000 : Email:d.scott at auckland.ac.nz : : Graduate Officer, Department of Statistics : : __ : R-help at stat.math.ethz.ch mailing list : https://www.stat.math.ethz.ch/mailman/listinfo/r-help : PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html : : __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] R on Windows Hangs on Packages Built from Sources
Hi, I am currently having the following problem with R 1.9.0. Any package that contains C or Fortran code hangs after I have built it and load it into R. I've tried this with RMySQL and udunits, originally I thought I had done something subtly wrong in configuring these packages; but I just had the same problem with a simple example R package that I wrote. I was able to build and load the package on a Linux system at school so I figure I've, hopefully, ruled out a programming problem on my part. The system I'm having the problem on is as follows: AMD AthlonXP R 1.9.0 installed from binaries GCC 3.3.1 Thanks, James __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] copying R objects in C
answer to myself: the 'duplicate' function does this, am I right? It seems so Gabor On Thu, May 06, 2004 at 02:18:19AM +0200, Csardi Gabor wrote: Dear R Users, do you know a way to copy an R object using C code? I know that there is a copyMatrix and also a copyVector function. There is also something called copyListMatrix, what is this good for? Is there anything for copying a list (of course deep copy is needed)? Thank you for your help, Gabor [...] -- Csardi Gabor [EMAIL PROTECTED]MTA RMKI, ELTE TTK __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Printing ps pictures with transparent b'ground
Hi all I wish to create a ps file of a picture produced in R. With my limited R, I see two ways: 1. Print direct to the postscript device 2. Print to the screen, and save to ps using dev.print. I want a white (not transparent) background. Option 1 above works fine, but 2 does not: even when I say I want a white background, I get transparent; perhaps I misread the help files. Here's some R code: ### Method 1 ### - print straight to postscript device postscript(horizontal=FALSE, onefile=FALSE, bg=white, width=4, height=4, paper=special, file=testfile.eps ) curve( dnorm, from=-3, to=3) dev.off() ### Method 2 ### - print to screen, and save using postscript x11(width=4, height=4) curve( dnorm, from=-3, to=3) dev.print( postscript, horizontal=FALSE, onefile=FALSE, bg=white, width=4, height=4, paper=special, file=testfile2.eps ) I then want to place these files in a LaTeX prosper document for a presentation. A typical (minimal) prosper file is: \documentclass[pdf,colorBG,slideColor,whitecross]{prosper} \begin{document} \begin{slide}{Print to \textsc{ps} direct} \includegraphics{testfile.eps} \end{slide} \begin{slide}{Print to screen first} \includegraphics{testfile2.eps} \end{slide} \end{document} The whitecross class provides a blue background for the presentation. testfile.eps appears with a white background on the slides, but testfile2.eps has a transparent background. I'd apprecaite if someone could explain why the two are not equivalent, or how I can coerce the second option to have a white background? Or even explain my misunderstandings (assuming (with high probability) that I have some). Thanks. P. version _ platform i686-pc-linux-gnu arch i686 os linux-gnu system i686, linux-gnu status major1 minor8.1 year 2003 month11 day 21 language R -- Dr Peter Dunn (USQ CRICOS No. 00244B) Web:http://www.sci.usq.edu.au/staff/dunn Email: dunn @ usq.edu.au Opinions expressed are mine, not those of USQ. Obviously... __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html