[R] any linear programming routine in R
Dear all is there any linear programming routine available for R? if not, can you suggest any alternatives? not need to be very powerful, I get only a samll problem to resolve. many thanks yong __ [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] Parsing results from boot
This probably has a super easy answer...but I claim newbie status! (I did search help lists but this question is hard to isolate keyword-wise) Basically, I'm trying to figure out how to parse the results from executing boot(). I'm mainly interested in assigning the standard error estimate to a scalar variable. For example: -- > b<-c(100,100,120,130,1000,1200,1100,1150,125) > b.boot <- boot(b, function(b,i) median(b[i]), R=1000) > b.boot ORDINARY NONPARAMETRIC BOOTSTRAP Call: boot(data = b, statistic = function(b, i) median(b[i]), R = 1000) Bootstrap Statistics : original biasstd. error t1* 130 354.75450.9763 > -- I'm interested in the value for std.error (i.e. 450.9763). Now executing the folling: -- > summary(b.boot) Length Class Mode t0 1 -none- numeric t 1000 -none- numeric R1 -none- numeric data 9 -none- numeric seed 626 -none- numeric statistic1 -none- function sim 1 -none- character call 4 -none- call stype1 -none- character strata 9 -none- numeric weights 9 -none- numeric > --- seems to imply that it's not actually assigned to an output variable...but it is shown when I just type "b.boot" Where is the std.error being assigned? and how to I access it? Thanks in advance... -Scott __ [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] mkChar can be interrupted
Thank you. This gives hope, I am looking forward to the next major release. May I make a wish that the future try/finally mechanism will inlcude support for C++ exceptions? For example by allowing the programmer to set an error handler that raises a C++ exception. It should be easy in error(), but might be a problem in interrupt handlers (I am not an expert though). Thanks, Vadim > -Original Message- > From: Luke Tierney [mailto:[EMAIL PROTECTED] > Sent: Monday, June 14, 2004 7:46 PM > To: Vadim Ogranovich > Cc: R-Help > Subject: RE: [R] mkChar can be interrupted > > On Mon, 14 Jun 2004, Vadim Ogranovich wrote: > > > This is disappointing. How on Earth can mkChar know when it > is safe or > > not to make a long jump? For example if I just opened a > file how am I > > supposed to close it after the long jump? I am not even > talking about > > C++ where long jumps are simply devastating... (and this is the > > C++ language > > I am coding in :-( ) > > > > Ok. A practical question: is it possible to somehow block > > R_CheckUserInterrupt? I am ready to put up with > out-of-memory errors, > > but Ctrl-C is too common to be ignored. > > Interrupts are not the issue. The issue is making sure that > cleanup actions occur even if there is a non-local exit. A > solution that addresses that issue will work for any > non-local exit, whether it comes from an interrupt or an > exception. So you don't have to put up with anything if you > approach this the right way, > > Currently there is no user accessible C level try/finally > mechanism for insuring that cleanup code is executed during a > non-local exit. > We should make such a mechanicm available; maybe one will > make it into the next major release. > > For now you have two choices: > > You can create an R level object and attach a finalizer > to the object > that will arrange for the GC to close the file at some > point in the > future if a non-local exit occurs. Search > developer.r-project.org for > finalization and weak references for some info on this. > > One other option is to use the R_ToplevelExec function. > This has some > drawbacks since it effectively makes invisible all other error > handlers, but it is an option. It is also not officially > documented > and subject to change. > > > And I think it makes relevant again the question I asked in another > > related thread: how is memory allocated by Calloc() and R_alloc() > > stand up against long jumps? > > R_alloc is stack-based; the stack is unwound on a non-local > exit, so this is released on regular exits and non-local > ones. It uses R allocation, so it could itself cause a > non-local exit. > > Calloc is like calloc but will never return NULL. If the > allocation fails, then an error is signaled, which will > result in a non-local exit. If the allocation succeeds, you > are responsable for calling Free. > > luke > > > > -Original Message- > > > From: Luke Tierney [mailto:[EMAIL PROTECTED] > > > Sent: Monday, June 14, 2004 5:43 PM > > > To: Vadim Ogranovich > > > Cc: R-Help > > > Subject: RE: [R] mkChar can be interrupted > > > > > > On Mon, 14 Jun 2004, Vadim Ogranovich wrote: > > > > > > > I am confused. Here is an excerpt from R-exts: > > > > > > > > "As from R 1.8.0 no port of R can be interrupted whilst > > > running long > > > > computations in compiled code,..." > > > > > > > > Doesn't it imply that the primitive functions like allocVector, > > > > mkChar, etc., which are likely to occur in any compiled code > > > > called via .Call, are not supposed to handle interrupts > in any way? > > > > > > No it does not. Read the full context. It says that if > you wite a > > > piece of C code that may run a long time and you want to > guarantee > > > that users will be able to interrupt your code then you should > > > insure that R_CheckUserInterrupt is called periodically. If your > > > code already periodically calls other R code that checks for > > > interrupts then you may not need to do this yourself, but > in general > > > you do. > > > > > > Prior to 1.8.0 on Unix-like systems the asynchronous > signal handler > > > for SIGINT would longjmp to the nearest top level or browser > > > context, which meant that on these sytems any code was > interruptible > > > at any point unless it was explicitly protected by a > construct that > > > suspended interrupts. Allowing interrupts at any point > meant that > > > inopportune interrupts could and did crash R, which is > why this was > > > changed. > > > > > > Unless there is explicit documentation to the contrary you should > > > assume that every function in the R API might allocate and might > > > cause a non-local exit (i.e. a longjmp) when an exception > is raised > > > (and an interrupt is one of, but only one of, the exceptions that > > > might occur). > > > > > > luke > > > > > > > Thanks, > > > > Vadim
RE: [R] mkChar can be interrupted
On Mon, 14 Jun 2004, Vadim Ogranovich wrote: > This is disappointing. How on Earth can mkChar know when it is safe or > not to make a long jump? For example if I just opened a file how am I > supposed to close it after the long jump? I am not even talking about > C++ where long jumps are simply devastating... (and this is the language > I am coding in :-( ) > > Ok. A practical question: is it possible to somehow block > R_CheckUserInterrupt? I am ready to put up with out-of-memory errors, > but Ctrl-C is too common to be ignored. Interrupts are not the issue. The issue is making sure that cleanup actions occur even if there is a non-local exit. A solution that addresses that issue will work for any non-local exit, whether it comes from an interrupt or an exception. So you don't have to put up with anything if you approach this the right way, Currently there is no user accessible C level try/finally mechanism for insuring that cleanup code is executed during a non-local exit. We should make such a mechanicm available; maybe one will make it into the next major release. For now you have two choices: You can create an R level object and attach a finalizer to the object that will arrange for the GC to close the file at some point in the future if a non-local exit occurs. Search developer.r-project.org for finalization and weak references for some info on this. One other option is to use the R_ToplevelExec function. This has some drawbacks since it effectively makes invisible all other error handlers, but it is an option. It is also not officially documented and subject to change. > And I think it makes relevant again the question I asked in another > related thread: how is memory allocated by Calloc() and R_alloc() stand > up against long jumps? R_alloc is stack-based; the stack is unwound on a non-local exit, so this is released on regular exits and non-local ones. It uses R allocation, so it could itself cause a non-local exit. Calloc is like calloc but will never return NULL. If the allocation fails, then an error is signaled, which will result in a non-local exit. If the allocation succeeds, you are responsable for calling Free. luke > > -Original Message- > > From: Luke Tierney [mailto:[EMAIL PROTECTED] > > Sent: Monday, June 14, 2004 5:43 PM > > To: Vadim Ogranovich > > Cc: R-Help > > Subject: RE: [R] mkChar can be interrupted > > > > On Mon, 14 Jun 2004, Vadim Ogranovich wrote: > > > > > I am confused. Here is an excerpt from R-exts: > > > > > > "As from R 1.8.0 no port of R can be interrupted whilst > > running long > > > computations in compiled code,..." > > > > > > Doesn't it imply that the primitive functions like allocVector, > > > mkChar, etc., which are likely to occur in any compiled code called > > > via .Call, are not supposed to handle interrupts in any way? > > > > No it does not. Read the full context. It says that if you > > wite a piece of C code that may run a long time and you want > > to guarantee that users will be able to interrupt your code > > then you should insure that R_CheckUserInterrupt is called > > periodically. If your code already periodically calls other > > R code that checks for interrupts then you may not need to do > > this yourself, but in general you do. > > > > Prior to 1.8.0 on Unix-like systems the asynchronous signal > > handler for SIGINT would longjmp to the nearest top level or > > browser context, which meant that on these sytems any code > > was interruptible at any point unless it was explicitly > > protected by a construct that suspended interrupts. Allowing > > interrupts at any point meant that inopportune interrupts > > could and did crash R, which is why this was changed. > > > > Unless there is explicit documentation to the contrary you > > should assume that every function in the R API might allocate > > and might cause a non-local exit (i.e. a longjmp) when an > > exception is raised (and an interrupt is one of, but only one > > of, the exceptions that might occur). > > > > luke > > > > > Thanks, > > > Vadim > > > > > > > > > > From: Luke Tierney [mailto:[EMAIL PROTECTED] > > > > > > > > On Mon, 14 Jun 2004, Vadim Ogranovich wrote: > > > > > > > > > > From: Luke Tierney [mailto:[EMAIL PROTECTED] > > > ... > > > > > > > > > > > > Not sure why you think this suggest mkChar can be interrupted. > > > > > > > > > ... > > > > > > by calls to this function. I don't believe there are any > > > > such safe > > > > > > points in mkChar, but there are several potential ones > > > > within your > > > > > > example. > > > > > > > > > > Apart from mkChar I am only calling SET_STRING_ELT. Is this > > > > what you > > > > > mean? > > > > > > > > You are printing, you have an assignment expression, all of those > > > > contain points where an interrupt could be checked for. > > > > > > These are not relevant since Ctrl-C is pressed when the > > code is inside
Re: [R] terminology for frames and environments
There was a typo in the previous version of this message. Pela should have been Pel. Here it is corrected. Peter Dalgaard <[EMAIL PROTECTED]> > > > Gabor Grothendieck <[EMAIL PROTECTED]> writes: > > > Thomas Lumley u.washington.edu> writes: > > > > > The distinction between "environment" and "frame" is important. The frame > > > is what you find things in with get(, inherits=FALSE) and the environment > > > uses get(, environment=TRUE). > > > > The thing I find odd about this one is that if we have: > > > > e <- new.env() > > e$x <- 1 > > f <- new.env(parent=e) > > f$x # gives an error > > (Actually not. I get NULL) Sure. > > > > then I would have expected x to be returned since f is an environment > > and x is in that environment. On the other hand, if an environment > > is defined to be the same as a frame (and there is some other word for > > an environment and its ancestors) then the above notation makes sense. > > Why? f$x is documented to be basically equivalent to > get("x",f,inherits=FALSE). In contrast, > > > evalq(x,f) > [1] 1 > > works fine. Well this certainly is more environment-like if one defines environment as a frame plus ancestors but it does not address the issue that if f is an environment in that sense then $ "should" pick out its components. One can define + to mean subtraction but that's not natural. I agree that it would have been nice if environment had been used to mean a frame plus its ancestors and class(f) was "frame", not "environment" but, of course, that's not how it turned out. I think its better to maintain backward compatiblity as far as possible and make the terms suit rather than use environment in a way which is inconsistent with the way R works. In fact, it might have been nice if there were both a frame class and an environment class so one could have either behavior. With this new setup R might have worked like this: # create parent environment # (in the sense of frame+ancestors) & populate Pe <- new.env(): Pe$x <- 1 # create child environment Ce <- new.env(parent=Pe) # create corresponding frames Pf <- as.frame(Pe); Cf <- as.frame(Ce) # x exists in child environment exists(Ce$x) # TRUE # but not in child frame exists(Cf$x) # FALSE Unfortunately this can't be done without breaking backward compatibility although it would still be possible to come up with a new word for environment plus ancestors (call it the envlist class) using environment as a synonym for frame. In that case this example would become: # create parent using envlist class & populate Pel <- new.envlist(): Pel$x <- 1 # create child environment+ancestors class Cel <- new.envlist(parent=Pel) # create corresponding environments (in the sense of frames) Pe <- as.env(Pel); Ce <- as.env(Cel) # x exists in child environment exists(Cel$x) # TRUE # but not in child frame exists(Ce$x) # FALSE and this one is upwardly compatible with the current R. __ [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] mkChar can be interrupted
This is disappointing. How on Earth can mkChar know when it is safe or not to make a long jump? For example if I just opened a file how am I supposed to close it after the long jump? I am not even talking about C++ where long jumps are simply devastating... (and this is the language I am coding in :-( ) Ok. A practical question: is it possible to somehow block R_CheckUserInterrupt? I am ready to put up with out-of-memory errors, but Ctrl-C is too common to be ignored. And I think it makes relevant again the question I asked in another related thread: how is memory allocated by Calloc() and R_alloc() stand up against long jumps? Thanks, Vadim > -Original Message- > From: Luke Tierney [mailto:[EMAIL PROTECTED] > Sent: Monday, June 14, 2004 5:43 PM > To: Vadim Ogranovich > Cc: R-Help > Subject: RE: [R] mkChar can be interrupted > > On Mon, 14 Jun 2004, Vadim Ogranovich wrote: > > > I am confused. Here is an excerpt from R-exts: > > > > "As from R 1.8.0 no port of R can be interrupted whilst > running long > > computations in compiled code,..." > > > > Doesn't it imply that the primitive functions like allocVector, > > mkChar, etc., which are likely to occur in any compiled code called > > via .Call, are not supposed to handle interrupts in any way? > > No it does not. Read the full context. It says that if you > wite a piece of C code that may run a long time and you want > to guarantee that users will be able to interrupt your code > then you should insure that R_CheckUserInterrupt is called > periodically. If your code already periodically calls other > R code that checks for interrupts then you may not need to do > this yourself, but in general you do. > > Prior to 1.8.0 on Unix-like systems the asynchronous signal > handler for SIGINT would longjmp to the nearest top level or > browser context, which meant that on these sytems any code > was interruptible at any point unless it was explicitly > protected by a construct that suspended interrupts. Allowing > interrupts at any point meant that inopportune interrupts > could and did crash R, which is why this was changed. > > Unless there is explicit documentation to the contrary you > should assume that every function in the R API might allocate > and might cause a non-local exit (i.e. a longjmp) when an > exception is raised (and an interrupt is one of, but only one > of, the exceptions that might occur). > > luke > > > Thanks, > > Vadim > > > > > > > From: Luke Tierney [mailto:[EMAIL PROTECTED] > > > > > > On Mon, 14 Jun 2004, Vadim Ogranovich wrote: > > > > > > > > From: Luke Tierney [mailto:[EMAIL PROTECTED] > > ... > > > > > > > > > > Not sure why you think this suggest mkChar can be interrupted. > > > > > > > ... > > > > > by calls to this function. I don't believe there are any > > > such safe > > > > > points in mkChar, but there are several potential ones > > > within your > > > > > example. > > > > > > > > Apart from mkChar I am only calling SET_STRING_ELT. Is this > > > what you > > > > mean? > > > > > > You are printing, you have an assignment expression, all of those > > > contain points where an interrupt could be checked for. > > > > These are not relevant since Ctrl-C is pressed when the > code is inside > > for (i=0; i > SET_STRING_ELT(resSexp, i, mkChar("foo")); > > } > > > > Just look at the way I deliver the signal. > > > > __ > > [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 > > > > -- > Luke Tierney > University of Iowa Phone: 319-335-3386 > Department of Statistics andFax: 319-335-3017 >Actuarial Science > 241 Schaeffer Hall email: [EMAIL PROTECTED] > Iowa City, IA 52242 WWW: http://www.stat.uiowa.edu > > > __ [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] mixed models question
I am trying to fit the following linear model to logged per capita fecundity data (ie number of babies per female) for a mouse: RsNRlS <- glm(formula = ln.fecundity ~ summer.rainfall + N + lagged.rainfall + season, …) I am using this relationship in a simulation model, and the current statistical model I have fit is unsatisfactory. The problem is I get a global estimate of variance (MSE), but I think it varies across subsets of the data. Specifically, seasons when there is lots of reproduction (e.g. fall) tend to have high variance, while seasons with little reproduction (e.g. summer) have small amounts of variance. I am looking for a method for estimating the coefficients in my linear model, and estimating a separate error for subsets of the data (ie for each of the 4 seasons). The end goal is to take this linear model back into my simulation model to make predictions about fecundity, but with separate variance terms for subsets of the data. I thought of several solutions, but some seem pretty ad hoc, while I think others would suffer from loss of a lot of power due to small sample size. The solutions I thought of were: 1) Fit the linear model to all data, but then estimate variances by season directly from the residuals. Seems ad hoc given the assumption of common variance in the initial fitting. 2) Use regression weights by season to reweight the data points/fitted values. Then in the simulation model inflate/deflate the estimate of MSE by these weights – seems ad hoc too, as translating weights (which would presumably basically downgrade the importance of outliers) into something meaningful for prediction using the regression equation seems arbitrary. 3) Fit a separate model for each season, either assume the global model (but maybe get poor fits due to #parameter v. #data points) or try reducing models and choosing the best for each season using AIC. The problem with this is that I think that some parameters have effects common to all seasons – eg lagged rainfall represents the effect of rainfall drowning babies in their burrows prior to the age at which they can be captured. This is pretty clearly a strong effect, just based on graphing the data, so I am uncertain about loosing power by splitting it by season. 4) Fit a mixed model to all the data, treating each season as a random factor with levels 1 or 0, and estimating the variance for each. Again this seems somewhat ad hoc, although based on my reading in elementary texts it would allow me to estimate the variance component for each of the seasons. Based on talking to a colleague in my department some of the modern methods for fitting mixed models, in which the variance for each of the levels of a factor in a random effect can be estimated. That seems the best option, as it explicitly does what I want. However, it is well over my head in terms of either the R code or the statistical background. Can anyone suggest a good approach, or a published example, or some useful reading on how one might approach this problem? Chris Wilcox The Ecology Centre Department of Zoology and Entomology Brisbane, 4072 QLD Australia tel 61-7-3365-1686 fax 61-7-3365-1655 website www.uq.edu.au/~uqcwilco __ [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] terminology for frames and environments
Peter Dalgaard <[EMAIL PROTECTED]> > > > Gabor Grothendieck <[EMAIL PROTECTED]> writes: > > > Thomas Lumley u.washington.edu> writes: > > > > > The distinction between "environment" and "frame" is important. The frame > > > is what you find things in with get(, inherits=FALSE) and the environment > > > uses get(, environment=TRUE). > > > > The thing I find odd about this one is that if we have: > > > > e <- new.env() > > e$x <- 1 > > f <- new.env(parent=e) > > f$x # gives an error > > (Actually not. I get NULL) Sure. > > > > then I would have expected x to be returned since f is an environment > > and x is in that environment. On the other hand, if an environment > > is defined to be the same as a frame (and there is some other word for > > an environment and its ancestors) then the above notation makes sense. > > Why? f$x is documented to be basically equivalent to > get("x",f,inherits=FALSE). In contrast, > > > evalq(x,f) > [1] 1 > > works fine. Well this certainly is more environment-like if one defines environment as a frame plus ancestors but it does not address the issue that if f is an environment in that sense then $ "should" pick out its components. One can define + to mean subtraction but that's not natural. I agree that it would have been nice if environment had been used to mean a frame plus its ancestors and class(f) was "frame", not "environment" but, of course, that's not how it turned out. I think its better to maintain backward compatiblity as far as possible and make the terms suit rather than use environment in a way which is inconsistent with the way R works. In fact, it might have been nice if there were both a frame class and an environment class so one could have either behavior. With this new setup R might have worked like this: # create parent environment # (in the sense of frame+ancestors) & populate Pe <- new.env(): Pe$x <- 1 # create child environment Ce <- new.env(parent=Pe) # create corresponding frames Pf <- as.frame(Pe); Cf <- as.frame(Ce) # x exists in child environment exists(Ce$x) # TRUE # but not in child frame exists(Cf$x) # FALSE Unfortunately this can't be done without breaking backward compatibility although it would still be possible to come up with a new word for environment plus ancestors (call it the envlist class) using environment as a synonym for frame. In that case this example would become: # create parent using envlist class & populate Pel <- new.envlist(): Pela$x <- 1 # create child environment+ancestors class Cel <- new.envlist(parent=Pel) # create corresponding environments (in the sense of frames) Pe <- as.env(Pel); Ce <- as.env(Cel) # x exists in child environment exists(Cel$x) # TRUE # but not in child frame exists(Ce$x) # FALSE and this one is upwardly compatible with the current R. __ [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] mkChar can be interrupted
On Mon, 14 Jun 2004, Vadim Ogranovich wrote: > I am confused. Here is an excerpt from R-exts: > > "As from R 1.8.0 no port of R can be interrupted whilst running long > computations in > compiled code,..." > > Doesn't it imply that the primitive functions like allocVector, mkChar, > etc., which are likely to occur in any compiled code called via .Call, > are not supposed to handle interrupts in any way? No it does not. Read the full context. It says that if you wite a piece of C code that may run a long time and you want to guarantee that users will be able to interrupt your code then you should insure that R_CheckUserInterrupt is called periodically. If your code already periodically calls other R code that checks for interrupts then you may not need to do this yourself, but in general you do. Prior to 1.8.0 on Unix-like systems the asynchronous signal handler for SIGINT would longjmp to the nearest top level or browser context, which meant that on these sytems any code was interruptible at any point unless it was explicitly protected by a construct that suspended interrupts. Allowing interrupts at any point meant that inopportune interrupts could and did crash R, which is why this was changed. Unless there is explicit documentation to the contrary you should assume that every function in the R API might allocate and might cause a non-local exit (i.e. a longjmp) when an exception is raised (and an interrupt is one of, but only one of, the exceptions that might occur). luke > Thanks, > Vadim > > > > From: Luke Tierney [mailto:[EMAIL PROTECTED] > > > > On Mon, 14 Jun 2004, Vadim Ogranovich wrote: > > > > > > From: Luke Tierney [mailto:[EMAIL PROTECTED] > ... > > > > > > > > Not sure why you think this suggest mkChar can be interrupted. > > > > > ... > > > > by calls to this function. I don't believe there are any > > such safe > > > > points in mkChar, but there are several potential ones > > within your > > > > example. > > > > > > Apart from mkChar I am only calling SET_STRING_ELT. Is this > > what you > > > mean? > > > > You are printing, you have an assignment expression, all of > > those contain points where an interrupt could be checked for. > > These are not relevant since Ctrl-C is pressed when the code is inside > for (i=0; i SET_STRING_ELT(resSexp, i, mkChar("foo")); > } > > Just look at the way I deliver the signal. > > __ > [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 > -- Luke Tierney University of Iowa Phone: 319-335-3386 Department of Statistics andFax: 319-335-3017 Actuarial Science 241 Schaeffer Hall email: [EMAIL PROTECTED] Iowa City, IA 52242 WWW: http://www.stat.uiowa.edu __ [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] SJava
Does anyone have any experience with SJava especially on Windows? __ [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] question about nlm function
Hello! I am a statistics graduate student and a new user of R. I am using nlm function to get estimates from a nonlinear function. I am running a simulation program. When I run the simulation with same set of starting vales then one third of the time I get bad results and I also noticed that I get good results corresponding to convergence code "2". So my question is that is there any way that I can make sure that everytime I use the nlm function, I can achieve the right convergence ie. successive iterates within tolerance, current iterate is probably solution (code=2). any help in this regard will be much appreciated. Thanks! Lovely Goyal Graduate Student Department of Statistics NCSU. - [[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] mkChar can be interrupted
I am confused. Here is an excerpt from R-exts: "As from R 1.8.0 no port of R can be interrupted whilst running long computations in compiled code,..." Doesn't it imply that the primitive functions like allocVector, mkChar, etc., which are likely to occur in any compiled code called via .Call, are not supposed to handle interrupts in any way? Thanks, Vadim > From: Luke Tierney [mailto:[EMAIL PROTECTED] > > On Mon, 14 Jun 2004, Vadim Ogranovich wrote: > > > > From: Luke Tierney [mailto:[EMAIL PROTECTED] ... > > > > > > Not sure why you think this suggest mkChar can be interrupted. > > > ... > > > by calls to this function. I don't believe there are any > such safe > > > points in mkChar, but there are several potential ones > within your > > > example. > > > > Apart from mkChar I am only calling SET_STRING_ELT. Is this > what you > > mean? > > You are printing, you have an assignment expression, all of > those contain points where an interrupt could be checked for. These are not relevant since Ctrl-C is pressed when the code is inside for (i=0; ihttps://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Question about nlm function
Hello! I am a statistics graduate student and a new user of R. I am using nlm function to get estimates from a nonlinear function. I am running a simulation program. When I run the simulation with same set of starting vales then one third of the time I get bad results and I also noticed that I get good results corresponding to convergence code "2". So my question is that is there any way that I can make sure that everytime I use the nlm function, I can achieve the right convergence ie. successive iterates within tolerance, current iterate is probably solution (code=2). any help in this regard will be much appreciated. Thanks! Lovely Goyal Graduate Student Department of Statistics NCSU. - [[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] mkChar can be interrupted
On Mon, 14 Jun 2004, Vadim Ogranovich wrote: > > -Original Message- > > From: Luke Tierney [mailto:[EMAIL PROTECTED] > > Sent: Monday, June 14, 2004 1:30 PM > > To: Vadim Ogranovich > > Cc: R-Help > > Subject: Re: [R] mkChar can be interrupted > > > > Not sure why you think this suggest mkChar can be interrupted. > > > > If you want to figure out how interrupt handling works on > > unix, run under gdb and single step from the signal to the > > next point where R_CheckUserInterrupt is called. You should > > find that the signal handler sets a flag and that flag is > > checked at various safe points by calls to this function. I > > don't believe there are any such safe points in mkChar, but > > there are several potential ones within your example. > > Apart from mkChar I am only calling SET_STRING_ELT. Is this what you > mean? You are printing, you have an assignment expression, all of those contain points where an interrupt could be checked for. > To make sure, I am not trying to enable or handle interrupts. On the > contrary, I want them to be disabled for the duration of .Call, which is > what I thought R was supposed to do for me. I am surprised it didn't. > > As to why I singled out mkChar, well, strictly speaking it is > 'SET_STRING_ELT(resSexp, i, mkChar("foo"))' where the interrupt somehow > goes through. But SET_STRING_ELT is much faster than mkChar so I guessed > that it must be mkChar. > Anyway, be it SET_STRING_ELT or mkChar, the interrupt should have been > blocked. Not sure why you are guessing since you can find out for sure using gdb. Looking at the current definition of the END_SUSPEND_INTERRUPTS macro it seems that on systems where user interrupt uses signals a pending interrupt will be handled at the end of a GC by calling onintr. So on unix systems mkChar would contain a safe point. This may be where the interrupt is handled in your case. If you want to you can confirm this by setting a gdb breakpoint in onintr (or perhaps Rf_onintr). (We should probably add a way of checking of user interrupts here on non-unix systems too, though care is needed on performance.) > As an additional check I tried to interrupt right before and right after > for (i=0; i SET_STRING_ELT(resSexp, i, mkChar("foo")); > } > but the interrupt was rightfully blocked. > > > I understand that .Call blocks interrupts, but it seems that very > primitive functions like SET_STRING_ELT, mkChar can decide to handle > them. This is surprising and I think my conjecture is wrong, but how > else to explain that I was able to interrupt 'foo0'? At this point it looks like nothing other than GC and some graphics code actually blocks interrupts. Whether any ot these are still necessary given that we no longer longjmp oout of the signal handler is not clear. Interrputs are checked for at places where it is safe to do a non-local exit, which on unix systems includes at the end of a GC. Any C code that uses R allocation has to be robust to non-local exits out of allocation calls since out of memory situations will also cause a non-local exit. Similarly any C code that calls into the R API has to be robust to non-local exits if the internal code can generate an error, and for this purpose a user interrupt is analogous to any other error. Best, luke > > As mentioned in a reply in another thread, interrupt handling > > is one aspect of R internals that is still evolving. Among > > other things, we will need to make changes as we improve > > support for other event loops. > > [In applications with graphical interfaces signals are not > > the right way to deal with user interruption (in particular > > on operating systems that don't support proper signals)]. > > > > Best, > > > > luke > > > > On Mon, 14 Jun 2004, Vadim Ogranovich wrote: > > > > > Hi, > > > > > > As was discussed earlier in another thread and as > > documented in R-exts > > > .Call() should not be interruptible by Ctrl-C. However the > > following > > > code, which spends most of its time inside mkChar, turned out to be > > > interruptible on RH-7.3 R-1.8.1 gcc-2.96: > > > > > > > > > #include > > > #include > > > > > > SEXP foo0(const SEXP nSexp) { > > > int i, n; > > > SEXP resSexp; > > > > > > if (!isInteger(nSexp)) > > > error("wrong arg type\n"); > > > > > > n = asInteger(nSexp); > > > resSexp = PROTECT(allocVector(STRSXP, n)); > > > > > > Rprintf("!!!time to interrup!!!\n"); > > > for (i=0; i > > SET_STRING_ELT(resSexp, i, mkChar("foo")); > > > } > > > > > > Rprintf("end mkChar\n"); > > > UNPROTECT(1); > > > > > > return R_NilValue; > > > } > > > > > > > > > > > > # invoke 'foo0' and give it an argument large enough to let > > you type > > > Ctrl-C # double the argument if you see "end mkChar" and do > > it again > > > :-) > > > > x <- .Call("foo0", as.integer(1e7)) > > > !!!time to interrup!!! > > > > > > > > > > > version > > > _
Re: [R] glmmML package
On Mon, 14 Jun 2004, Small, Dylan wrote: > I'm trying to use the glmmML package on a Windows machine. When I try to install > the package, I get the message: > > > {pkg <- select.list(sort(.packages(all.available = TRUE))) > + if(nchar(pkg)) library(pkg, character.only=TRUE)} > Error in dyn.load(x, as.logical(local), as.logical(now)) : > unable to load shared library > "C:/PROGRA~1/R/rw1051/library/glmmML/libs/glmmML.dll": > LoadLibrary failure: The specified procedure could not be found. > In addition: Warning message: > package glmmML was built under R version 1.9.0 > Error in library(pkg, character.only = TRUE) : > .First.lib failed > > Does anybody know how to correct this problem? Thanks. Upgrading your version of R would be a good start -- it looks as though you are still using 1.5.1. This might fix the problem, and if it doesn't, it will at least make it easier for people to duplicate it and help you. -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] mkChar can be interrupted
> -Original Message- > From: Luke Tierney [mailto:[EMAIL PROTECTED] > Sent: Monday, June 14, 2004 1:30 PM > To: Vadim Ogranovich > Cc: R-Help > Subject: Re: [R] mkChar can be interrupted > > Not sure why you think this suggest mkChar can be interrupted. > > If you want to figure out how interrupt handling works on > unix, run under gdb and single step from the signal to the > next point where R_CheckUserInterrupt is called. You should > find that the signal handler sets a flag and that flag is > checked at various safe points by calls to this function. I > don't believe there are any such safe points in mkChar, but > there are several potential ones within your example. Apart from mkChar I am only calling SET_STRING_ELT. Is this what you mean? To make sure, I am not trying to enable or handle interrupts. On the contrary, I want them to be disabled for the duration of .Call, which is what I thought R was supposed to do for me. I am surprised it didn't. As to why I singled out mkChar, well, strictly speaking it is 'SET_STRING_ELT(resSexp, i, mkChar("foo"))' where the interrupt somehow goes through. But SET_STRING_ELT is much faster than mkChar so I guessed that it must be mkChar. Anyway, be it SET_STRING_ELT or mkChar, the interrupt should have been blocked. As an additional check I tried to interrupt right before and right after for (i=0; i > As mentioned in a reply in another thread, interrupt handling > is one aspect of R internals that is still evolving. Among > other things, we will need to make changes as we improve > support for other event loops. > [In applications with graphical interfaces signals are not > the right way to deal with user interruption (in particular > on operating systems that don't support proper signals)]. > > Best, > > luke > > On Mon, 14 Jun 2004, Vadim Ogranovich wrote: > > > Hi, > > > > As was discussed earlier in another thread and as > documented in R-exts > > .Call() should not be interruptible by Ctrl-C. However the > following > > code, which spends most of its time inside mkChar, turned out to be > > interruptible on RH-7.3 R-1.8.1 gcc-2.96: > > > > > > #include > > #include > > > > SEXP foo0(const SEXP nSexp) { > > int i, n; > > SEXP resSexp; > > > > if (!isInteger(nSexp)) > > error("wrong arg type\n"); > > > > n = asInteger(nSexp); > > resSexp = PROTECT(allocVector(STRSXP, n)); > > > > Rprintf("!!!time to interrup!!!\n"); > > for (i=0; i > SET_STRING_ELT(resSexp, i, mkChar("foo")); > > } > > > > Rprintf("end mkChar\n"); > > UNPROTECT(1); > > > > return R_NilValue; > > } > > > > > > > > # invoke 'foo0' and give it an argument large enough to let > you type > > Ctrl-C # double the argument if you see "end mkChar" and do > it again > > :-) > > > x <- .Call("foo0", as.integer(1e7)) > > !!!time to interrup!!! > > > > > > > > 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 > > > > > > Thanks, > > Vadim > > > > __ > > [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 > > > > -- > Luke Tierney > University of Iowa Phone: 319-335-3386 > Department of Statistics andFax: 319-335-3017 >Actuarial Science > 241 Schaeffer Hall email: [EMAIL PROTECTED] > Iowa City, IA 52242 WWW: http://www.stat.uiowa.edu > > > __ [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] error with barplot command?
(Ted Harding) <[EMAIL PROTECTED]> writes: > > > > Please try 1.9.1 beta. This should be fixed now... > > Hmmm. > R > major1 > minor8.0 > year 2003 > > table(beer) > beer > 1 2 3 4 > 10 4 8 3 > > and barplot(table(beer)) looks fine! Does this mean that barplot() > got un-fixed between 1.8.0 and 1.9.0? Yes. (Actually, fixed incorrectly, the 1.9.1 version should be finer than 1.8.1's) -- 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] olesolve: stepsize
"Zhixin Guan" <[EMAIL PROTECTED]> writes: > Hi, > > I am doing a project on the simulation of glucose metabolism based on a > pharmacokinetic modeling in which we have 4 differential equations. I did > this in R by using the odesolve package. It works very well, but I have two > questions: > > > > Here is the odemodel function > > _ > > Ogtt.Odemodel <- function(t, y, p) { . > } > First is that The computing time for each individual simulation is about 6 > sec if I set up time from 0 - 360 min and calculate on each minute. In > order to reduce computing time, I want to calculate for every two minutes, > but I don't know how to do it. I try to make t to be t <- seq(0, 360, by = > 2), however, the computing time is still about 6 sec instead of 3. I also > found that there is a hmin parameter in odesolve. But again, it doesn't > work. The thing you're not telling us is what solver you are using! lsoda(), I suppose. In that case, the times you specify are just read-off times, whereas the actual integration proceeds in potentially much smaller time step. If you want the solver to take larger steps, you should probably loosen the tolerances and maybe also increase hmin. > > The second question is that I found that some time, the last two or three > points of calculation is NA. This might be due to using approxfun with values beyond the end of your sx data. -- 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] How to 'stamp' a plot with meta-data?
I use this little function for adding a datestamp manually. runstamp <- function (adj = 1, cex = 0.75, line = 4) mtext(format(Sys.time()), side = 1, adj = adj, cex = cex, line = line) Since the default lower margin is 5.1, line = 4 works pretty well. You can, of course, put any other information you want in there. But to have it all automated looks to me like a major task. I wouldn't get my hopes up. At 12:17 PM -0700 6/14/04, Itay Furman wrote: Dear R users, Sometimes, for tracking purposes, I am interested to add to a plot some metadata such as * the date it was produced * filename that stores the plot * perhaps data sources, author, etc Ideally, I would like to be able to do this for any kind of plot, plot(), barplot(), hist(), etc.; and, to be able to produce plots with or without the metadata by a simple toggle mechanism. Something like: # 'Clean' plot some.plot.func()# plot() or barplot() or ... # Now with metadata options(metadata=TRUE) # Or some other toggle mechanism some.plot.func()# Same plot as above, but with wider # bottom margins that show the # metadata. So far I looked in "Introduction to R" and tried to find hints using help.search() without success. Is it possilbe to do? Any suggestions or pointers as to how to do it are appreciated. Even partial solution in which the plot is set up to accomodate metadata in the margins, but the data needs to be added manually after plot()ting will be great. Thanks in advance, Itay -- [EMAIL PROTECTED] Fred Hutchinson Cancer Research Center __ [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 -- -- Don MacQueen Environmental Protection Department Lawrence Livermore National Laboratory Livermore, CA, USA __ [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] terminology for frames and environments
Gabor Grothendieck <[EMAIL PROTECTED]> writes: > Thomas Lumley u.washington.edu> writes: > > > The distinction between "environment" and "frame" is important. The frame > > is what you find things in with get(, inherits=FALSE) and the environment > > uses get(, environment=TRUE). > > The thing I find odd about this one is that if we have: > > e <- new.env() > e$x <- 1 > f <- new.env(parent=e) > f$x # gives an error (Actually not. I get NULL) > then I would have expected x to be returned since f is an environment > and x is in that environment. On the other hand, if an environment > is defined to be the same as a frame (and there is some other word for > an environment and its ancestors) then the above notation makes sense. Why? f$x is documented to be basically equivalent to get("x",f,inherits=FALSE). In contrast, > evalq(x,f) [1] 1 works fine. -- 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] error with barplot command?
On 14-Jun-04 Duncan Murdoch wrote: > On Tue, 15 Jun 2004 01:40:49 +0800, »ÆÈÙ¹ó <[EMAIL PROTECTED]> > wrote : > >>when i use barplot ,it seems there is sth wrong with it. >>my command are: >>> beer = scan() >>1: 3 4 1 1 3 4 3 3 1 3 2 1 2 1 2 3 2 3 1 1 1 1 4 3 1 >>26: >>Read 25 items >>> barplot(table(beer)) >> >>but it does NOT produce what i want. > > Please try 1.9.1 beta. This should be fixed now... Hmmm. R major1 minor8.0 year 2003 table(beer) beer 1 2 3 4 10 4 8 3 and barplot(table(beer)) looks fine! Does this mean that barplot() got un-fixed between 1.8.0 and 1.9.0? Ted. E-Mail: (Ted Harding) <[EMAIL PROTECTED]> Fax-to-email: +44 (0)870 167 1972 Date: 14-Jun-04 Time: 22:43:27 -- XFMail -- __ [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] terminology for frames and environments
Thomas Lumley u.washington.edu> writes: : If you think of the nested structure then : it does make sense and is analogous to what happens with more complicated : lists and expressions. : : If you had :e<-quote(b*x) :f<- substitute(a+tmp,list(tmp=e)) : x would not appear as an element of f, but would appear as an element of : an element (yes, I do realise the tree is upside-down compared to an tree : of environments). To me this is not inconsistent with a list being analogous to a frame. In both cases a deep search does not take place.Thus a frame is a shallow structure and an environment defined as a frame and its ancestors is a deep structure (with respect to its parent) so I would expect that the deep structure would search deeply. __ [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] Readline on R-1.9.1a
Hi Peter! Thanks so much for your help. Installing ncurses and ncurses-devel did the trick for me, and now readline's working fine in R. Now how did you manage to notice that? Kevin -Original Message- From: Peter Dalgaard [mailto:[EMAIL PROTECTED] Sent: Monday, June 14, 2004 1:20 PM To: Liaw, Andy Cc: 'Roger D. Peng'; 'Peter Dalgaard'; Kevin Bartz; [EMAIL PROTECTED] Subject: Re: [R] Readline on R-1.9.1a "Liaw, Andy" <[EMAIL PROTECTED]> writes: > > From: Roger D. Peng > > > > People who compile from source still need to install the > > necessary rpms. > > Sure, but apparently one can install the R rpm without those, and that's the > real problem. (Wasn't Kevin's though. But there's really no way of helping people who build from source, beyond what they get from configure. Well, you could refer them to read the spec files...) You can actually *build* the R rpm on SuSE without a lot of stuff... Detlef has put absolutely no dependency information in the spec file. -- 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] glmmML package
I'm trying to use the glmmML package on a Windows machine. When I try to install the package, I get the message: > {pkg <- select.list(sort(.packages(all.available = TRUE))) + if(nchar(pkg)) library(pkg, character.only=TRUE)} Error in dyn.load(x, as.logical(local), as.logical(now)) : unable to load shared library "C:/PROGRA~1/R/rw1051/library/glmmML/libs/glmmML.dll": LoadLibrary failure: The specified procedure could not be found. In addition: Warning message: package glmmML was built under R version 1.9.0 Error in library(pkg, character.only = TRUE) : .First.lib failed Does anybody know how to correct this problem? Thanks. Dylan Small __ [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] olesolve: stepsize
Hi, I am doing a project on the simulation of glucose metabolism based on a pharmacokinetic modeling in which we have 4 differential equations. I did this in R by using the odesolve package. It works very well, but I have two questions: Here is the odemodel function _ Ogtt.Odemodel <- function(t, y, p) { absx <- c(-60, -45, -30, -15, 0, 5, 10, 15, 20, 25, 30, 45, 60, 75, 90, 105, 120, 140, 160, 180, 210, 240, 270, 301) absx <- absx + 60 absy <- c(0, 0, 0, 0, 0, 156.1225165, 266.8509934, 432.5794702, 609.8807946, 759.0364238, 824.7649004, 636.0562915, 482.7450332, 395.1870861, 329.1953641, 591.2408942, 214.6274834, 180.316, 123.3885, 111.0497, 88.83972, 53.30383, 21.32153, 0) sx <- c(-60, -37.5, -22.5, -7.5, 0, 2.5, 7.5, 12.5, 17.5, 22.5, 27.5, 37.5, 52.5, 67.5, 82.5, 97.5, 112.5, 130, 150, 170, 195, 225, 255, 285, 315) sx <- sx + 60 sy <- c(81.32, 81.32, 81.32, 81.32, 81.32, 218.24, 329.41, 448.82, 527.06, 588.82, 568.24, 613.53, 564.12, 415.88, 354.12, 325.29, 267.65, 222.35, 115.29, 98.31, 89.81, 85.57, 81.32, 81.32, 81.32) abs <- approxfun(absx, absy, method = "linear") s<- approxfun(sx, sy, method = "linear") Rtb <- 81.32 ib <- ((1-p["f"])*Rtb*p["kg"]*(p["hgo0"]/p["vg"])/(p["k21"] + p["k01"] + p["kl"] - p["k21"]*p["k12"]/(p["k12"] + p["k02"]))/(p["ki"]*p["vi"])) # G1(t)-y(1); G2(t)-y(2);I(t)-y(3); X(t)-y(4) yd1 <- (abs(t) + p["hgo0"] - (p["kl"] + p["fx"]*y[4])*y[1]*p["vg"] + p["k12"]*y[2])/p["vg"] - (p["k21"] + p["k01"])*y[1] yd2 <- p["k21"]*y[1]*p["vg"] - (p["k12"] + p["k02"] + (1-p["fx"])*y[4])*y[2] yd3 <- (1-p["f"])*s(t)*p["kg"]*y[1]/p["vi"] - p["ki"]*y[3] yd4 <- -p["p2"]*y[4] + p["p3"]*(y[3]-ib) list(c(yd1, yd2, yd3, yd4)) } __ First is that The computing time for each individual simulation is about 6 sec if I set up time from 0 - 360 min and calculate on each minute. In order to reduce computing time, I want to calculate for every two minutes, but I don't know how to do it. I try to make t to be t <- seq(0, 360, by = 2), however, the computing time is still about 6 sec instead of 3. I also found that there is a hmin parameter in odesolve. But again, it doesn't work. The second question is that I found that some time, the last two or three points of calculation is NA. Thanks. Guan [[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] interrupt in Linux
On 14-Jun-04 Bickel, David wrote: > Does anyone know how to interrupt R in RedHat? Neither control-c nor > Esc is working. What I don't want to do is close the window or kill the > entire R process. > > Thanks, > David Ctrl-C should interrupt what R is doing and return you to the R command prompt. ESC (at the R command prompt) will probably be seen by 'readline' as the lead-in to an escape sequence, with possibly unpredictable results. For example, > for(i in (1:10^5)){rnorm(10)} takes about 20 seconds on my old laptop. However, if I start it again, and press Ctrl-C after a couple os seconds, then it stops almost immediately. Red Hat 9.1, R version 1.8.0 But I think R may need to unwind things that it has set up before returning to the prompt when you press Ctrl-C, so if what you were doing has made a lot of heavy stuff, then it might take a while before you get the prompt back. If Ctrl-C really won't work at all, then you may have an stty problem. In a normal xterm window (shell prompt) enter stty -a which should return a lot of stuff beginning like: > stty -a speed 38400 baud; rows 56; columns 80; line = 0; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ; ... ... and you need to see the "intr = ^C". If not, then you don't have Ctrl-C set as interrupt. In which case, consult "man stty"! Ted. E-Mail: (Ted Harding) <[EMAIL PROTECTED]> Fax-to-email: +44 (0)870 167 1972 Date: 14-Jun-04 Time: 21:21:40 -- XFMail -- __ [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] How to 'stamp' a plot with meta-data?
I would take the metadata and plot it at the bottom (or top - your preference) using mtext. Check out the options oma and the usage of mtext. Partha Itay Furman <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 06/14/2004 03:17 PM Please respond to Itay Furman To: [EMAIL PROTECTED] cc: Subject:[R] How to 'stamp' a plot with meta-data? Dear R users, Sometimes, for tracking purposes, I am interested to add to a plot some metadata such as * the date it was produced * filename that stores the plot * perhaps data sources, author, etc Ideally, I would like to be able to do this for any kind of plot, plot(), barplot(), hist(), etc.; and, to be able to produce plots with or without the metadata by a simple toggle mechanism. Something like: # 'Clean' plot some.plot.func() # plot() or barplot() or ... # Now with metadata options(metadata=TRUE) # Or some other toggle mechanism some.plot.func() # Same plot as above, but with wider # bottom margins that show the # metadata. So far I looked in "Introduction to R" and tried to find hints using help.search() without success. Is it possilbe to do? Any suggestions or pointers as to how to do it are appreciated. Even partial solution in which the plot is set up to accomodate metadata in the margins, but the data needs to be added manually after plot()ting will be great. Thanks in advance, Itay -- [EMAIL PROTECTED] Fred Hutchinson Cancer Research Center __ [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 [[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] polygons around clusters of identically valued nodes in levelplot()
I'm looking for a way to plot lines on top of a levelplot(), where the lines are borders between cells of different values. The clines() function provides contours suitable for continuous data. I am dealing with discrete values, spatial clusters of nodes where each cluster has an integer value, and I want to plot the borderlines between these areas. So, in a levelplot having nodes with values 0, 1, or 2, I would like to plot lines between nodes having the values 0 and 1, 0 and 2 and 0 and 2. The contouring concept gives two lines for adjacent nodes having values of 0 and 1. Thanks, Scott Waichler Pacific Northwest National Laboratory Richland, Washington, USA [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] terminology for frames and environments
On Mon, 14 Jun 2004, Gabor Grothendieck wrote: > Thomas Lumley u.washington.edu> writes: > > > The distinction between "environment" and "frame" is important. The frame > > is what you find things in with get(, inherits=FALSE) and the environment > > uses get(, environment=TRUE). > > The thing I find odd about this one is that if we have: > > e <- new.env() > e$x <- 1 > f <- new.env(parent=e) > f$x # gives an error > > then I would have expected x to be returned since f is an environment > and x is in that environment. On the other hand, if an environment > is defined to be the same as a frame (and there is some other word for > an environment and its ancestors) then the above notation makes sense. > Maybe. On the other hand, $ *is* documented to look only in the first frame of the environment. It only doesn't make sense if you think of an environment as a flat vector. If you think of the nested structure then it does make sense and is analogous to what happens with more complicated lists and expressions. If you had e<-quote(b*x) f<- substitute(a+tmp,list(tmp=e)) x would not appear as an element of f, but would appear as an element of an element (yes, I do realise the tree is upside-down compared to an tree of environments). -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] interrupt in Linux
> version _ platform i686-pc-linux-gnu arch i686 os linux-gnu system i686, linux-gnu status major1 minor9.0 year 2004 month04 day 12 language R -Original Message- From: Roger D. Peng [mailto:[EMAIL PROTECTED] Sent: Monday, June 14, 2004 3:41 PM To: Bickel, David Cc: Patrick Burns; [EMAIL PROTECTED] Subject: Re: [R] interrupt in Linux What version of R are you using? This was a problem in 1.8.0 but I think was fixed in 1.8.1. -roger Bickel, David wrote: > Patrick, > > control-c seems to interrupt loops, but not the display of enormous objects, as when > I typed the name of a several-hundred megabyte list. Is there a way to interrupt > that? > > control-D does not interrupt R, but kills the entire R process. > > Thanks, > David > > -Original Message- > From: Patrick Burns [mailto:[EMAIL PROTECTED] > Sent: Monday, June 14, 2004 3:02 PM > To: Bickel, David > Subject: Re: [R] interrupt in Linux > > > Are you sure that R won't interrupt? Perhaps you are in some C > code that doesn't pay attention to the interrupt. > > I have SuSe and control-C works on all of the versions of R that > I've tried. > > > Patrick Burns > > Burns Statistics > [EMAIL PROTECTED] > +44 (0)20 8525 0696 > http://www.burns-stat.com > (home of S Poetry and "A Guide for the Unwilling S User") > > Bickel, David wrote: > > >>Does anyone know how to interrupt R in RedHat? Neither control-c nor Esc is working. >>What I don't want to do is close the window or kill the entire R process. >> >>Thanks, >>David >> >> >>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 >> >> >> >> > > > > > > > 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 > -- Roger D. Peng http://www.biostat.jhsph.edu/~rpeng _ David Bickel http://davidbickel.com Research Scientist Pioneer Hi-Bred International Bioinformatics & Discovery Research 7250 NW 62nd Ave., PO Box 552 Johnston, Iowa 50131-0552 515-270-0220 Home 515-334-4739 Work 515-334-6634 Fax [EMAIL PROTECTED], [EMAIL PROTECTED] 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] interrupt in Linux
What version of R are you using? This was a problem in 1.8.0 but I think was fixed in 1.8.1. -roger Bickel, David wrote: Patrick, control-c seems to interrupt loops, but not the display of enormous objects, as when I typed the name of a several-hundred megabyte list. Is there a way to interrupt that? control-D does not interrupt R, but kills the entire R process. Thanks, David -Original Message- From: Patrick Burns [mailto:[EMAIL PROTECTED] Sent: Monday, June 14, 2004 3:02 PM To: Bickel, David Subject: Re: [R] interrupt in Linux Are you sure that R won't interrupt? Perhaps you are in some C code that doesn't pay attention to the interrupt. I have SuSe and control-C works on all of the versions of R that I've tried. Patrick Burns Burns Statistics [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and "A Guide for the Unwilling S User") Bickel, David wrote: Does anyone know how to interrupt R in RedHat? Neither control-c nor Esc is working. What I don't want to do is close the window or kill the entire R process. Thanks, David 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 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 -- Roger D. Peng http://www.biostat.jhsph.edu/~rpeng __ [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] interrupt in Linux
Patrick, control-c seems to interrupt loops, but not the display of enormous objects, as when I typed the name of a several-hundred megabyte list. Is there a way to interrupt that? control-D does not interrupt R, but kills the entire R process. Thanks, David -Original Message- From: Patrick Burns [mailto:[EMAIL PROTECTED] Sent: Monday, June 14, 2004 3:02 PM To: Bickel, David Subject: Re: [R] interrupt in Linux Are you sure that R won't interrupt? Perhaps you are in some C code that doesn't pay attention to the interrupt. I have SuSe and control-C works on all of the versions of R that I've tried. Patrick Burns Burns Statistics [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and "A Guide for the Unwilling S User") Bickel, David wrote: >Does anyone know how to interrupt R in RedHat? Neither control-c nor Esc is working. >What I don't want to do is close the window or kill the entire R process. > >Thanks, >David > > >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 > > > > 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] terminology for frames and environments
Thomas Lumley u.washington.edu> writes: > The distinction between "environment" and "frame" is important. The frame > is what you find things in with get(, inherits=FALSE) and the environment > uses get(, environment=TRUE). The thing I find odd about this one is that if we have: e <- new.env() e$x <- 1 f <- new.env(parent=e) f$x # gives an error then I would have expected x to be returned since f is an environment and x is in that environment. On the other hand, if an environment is defined to be the same as a frame (and there is some other word for an environment and its ancestors) then the above notation makes sense. __ [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] mkChar can be interrupted
Not sure why you think this suggest mkChar can be interrupted. If you want to figure out how interrupt handling works on unix, run under gdb and single step from the signal to the next point where R_CheckUserInterrupt is called. You should find that the signal handler sets a flag and that flag is checked at various safe points by calls to this function. I don't believe there are any such safe points in mkChar, but there are several potential ones within your example. As mentioned in a reply in another thread, interrupt handling is one aspect of R internals that is still evolving. Among other things, we will need to make changes as we improve support for other event loops. [In applications with graphical interfaces signals are not the right way to deal with user interruption (in particular on operating systems that don't support proper signals)]. Best, luke On Mon, 14 Jun 2004, Vadim Ogranovich wrote: > Hi, > > As was discussed earlier in another thread and as documented in R-exts > .Call() should not be interruptible by Ctrl-C. However the following > code, which spends most of its time inside mkChar, turned out to be > interruptible on RH-7.3 R-1.8.1 gcc-2.96: > > > #include > #include > > SEXP foo0(const SEXP nSexp) { > int i, n; > SEXP resSexp; > > if (!isInteger(nSexp)) > error("wrong arg type\n"); > > n = asInteger(nSexp); > resSexp = PROTECT(allocVector(STRSXP, n)); > > Rprintf("!!!time to interrup!!!\n"); > for (i=0; i SET_STRING_ELT(resSexp, i, mkChar("foo")); > } > > Rprintf("end mkChar\n"); > UNPROTECT(1); > > return R_NilValue; > } > > > > # invoke 'foo0' and give it an argument large enough to let you type > Ctrl-C > # double the argument if you see "end mkChar" and do it again :-) > > x <- .Call("foo0", as.integer(1e7)) > !!!time to interrup!!! > > > > > 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 > > > Thanks, > Vadim > > __ > [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 > -- Luke Tierney University of Iowa Phone: 319-335-3386 Department of Statistics andFax: 319-335-3017 Actuarial Science 241 Schaeffer Hall email: [EMAIL PROTECTED] Iowa City, IA 52242 WWW: http://www.stat.uiowa.edu __ [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] Readline on R-1.9.1a
"Liaw, Andy" <[EMAIL PROTECTED]> writes: > > From: Roger D. Peng > > > > People who compile from source still need to install the > > necessary rpms. > > Sure, but apparently one can install the R rpm without those, and that's the > real problem. (Wasn't Kevin's though. But there's really no way of helping people who build from source, beyond what they get from configure. Well, you could refer them to read the spec files...) You can actually *build* the R rpm on SuSE without a lot of stuff... Detlef has put absolutely no dependency information in the spec file. -- 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] Readline on R-1.9.1a
Dirk Eddelbuettel <[EMAIL PROTECTED]> writes: > On Mon, Jun 14, 2004 at 04:01:02PM -0400, Roger D. Peng wrote: >> People who compile from source still need to install the necessary rpms. > > Which is why another Linux distribution uses the concept of Build-Depends :) Which is another reason why I use that other Linux distribution... -- [EMAIL PROTECTED]http://www.analytics.washington.edu/ Biomedical and Health Informatics University of Washington Biostatistics, SCHARP/HVTN Fred Hutchinson Cancer Research Center UW (Tu/Th/F): 206-616-7630 FAX=206-543-3461 | Voicemail is unreliable FHCRC (M/W): 206-667-7025 FAX=206-667-4812 | use Email CONFIDENTIALITY NOTICE: This e-mail message and any attachme...{{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] extracting p-value of aov F-statistic
Sven Hartenstein wrote: Hi, I would like to extract the p-value of the F-statistic of a aov-object's summary. Getting the p-value is so easy with t-tests (t.test(g1, y = g2, var.equal = FALSE)$p.value), but I couldn't find anything like that for ANOVAs. Look at str(summary(aov.object)) For example example(aov) str(summary(npk.aov)) __ [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] Readline on R-1.9.1a
> From: Roger D. Peng > > People who compile from source still need to install the > necessary rpms. Sure, but apparently one can install the R rpm without those, and that's the real problem. Andy > -roger > > Liaw, Andy wrote: > > Given this is turning out to be an FAQ, wouldn't it make > sense to have these > > rpm's as depends for the R rpm? (I always compile from > source, so don't > > know what the R rpm actually depends on.) > > > > Best, > > Andy __ [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] Readline on R-1.9.1a
On Mon, Jun 14, 2004 at 04:01:02PM -0400, Roger D. Peng wrote: > People who compile from source still need to install the necessary rpms. Which is why another Linux distribution uses the concept of Build-Depends :) This can be complicated if you strive to include just about everything that there is: [EMAIL PROTECTED]:~/src/debian/R/R-1.9.1/debian> grep Build-Depends control Build-Depends: refblas3-dev | atlas3-base-dev, lapack3-dev | atlas3-base-dev, libgnome-dev, libzvt-dev, libgtkxmhtml-dev, tcl8.4-dev, tk8.4-dev, libglade-gnome0-dev, bison, g77 [!m68k], f2c [m68k], groff-base, libncurses5-dev, libreadline4-dev, debhelper (>= 3.0.0), texi2html, texinfo (>= 4.1-2), libbz2-dev, libpcre3-dev, libpaperg-dev, tetex-bin, tetex-extra, xpdf-reader, libpaper-utils, zlib1g-dev, libpng12-dev, libjpeg62-dev, libpcre3-dev Dirk -- FEATURE: VW Beetle license plate in California __ [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] Quadruple precision in R
Hi: Is it possible to perform computations in quadruple precision (more generally, with more digits in the floating-point arithmetic than that allowed by double precision) in R? thanks, Ravi. [[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] Readline on R-1.9.1a
People who compile from source still need to install the necessary rpms. -roger Liaw, Andy wrote: Given this is turning out to be an FAQ, wouldn't it make sense to have these rpm's as depends for the R rpm? (I always compile from source, so don't know what the R rpm actually depends on.) Best, Andy From: Peter Dalgaard "Kevin Bartz" <[EMAIL PROTECTED]> writes: Hello! I'm trying to install R-1.9.1a with readline on Suse Linux. As recommended in other posts, I've installed readline and readline-devel: ... [EMAIL PROTECTED]:~/R-1.9.1> rpm -qa | grep readline readline-devel-32bit-9.0-0 readline-32bit-9.0-0 readline-4.3-207 readline-devel-4.3-207 ... configure:21307: gcc -o conftest -g -O2 -I/usr/local/include -L/usr/local/lib conftest.c \ -lreadline -ldl -lm >&5 /usr/local/lib/libreadline.so: undefined reference to `tgetnum' /usr/local/lib/libreadline.so: undefined reference to `tgoto' /usr/local/lib/libreadline.so: undefined reference to `tgetflag' /usr/local/lib/libreadline.so: undefined reference to `BC' /usr/local/lib/libreadline.so: undefined reference to `tputs' /usr/local/lib/libreadline.so: undefined reference to `PC' /usr/local/lib/libreadline.so: undefined reference to `tgetent' /usr/local/lib/libreadline.so: undefined reference to `UP' /usr/local/lib/libreadline.so: undefined reference to `tgetstr' ... Any ideas? Thanks for any help you can provide. Missing ncurses or ncurses-devel, I believe. -- 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 __ [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 -- Roger D. Peng http://www.biostat.jhsph.edu/~rpeng __ [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] extracting p-value of aov F-statistic
Sven: A suggestion from Peter Dalgaard in the archives: http://tolstoy.newcastle.edu.au/R/help/01a/2097.html data(warpbreaks) LZ.aov <- summary(aov(breaks ~ wool + tension, data = warpbreaks)) as.matrix(LZ.aov[[1]][,5]) [,1] [1,] 0.073613669 [2,] 0.00138 [3,] NA hope this helps, Chuck Cleland Sven Hartenstein wrote: I would like to extract the p-value of the F-statistic of a aov-object's summary. Getting the p-value is so easy with t-tests (t.test(g1, y = g2, var.equal = FALSE)$p.value), but I couldn't find anything like that for ANOVAs. Maybe something like: >?summary.aov will give you a clue Unfortunately not. I already checked summary, aov and lm help pages. -- Chuck Cleland, Ph.D. NDRI, Inc. 71 West 23rd Street, 8th floor New York, NY 10010 tel: (212) 845-4495 (Tu, Th) tel: (732) 452-1424 (M, W, F) fax: (917) 438-0894 __ [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] Readline on R-1.9.1a
Given this is turning out to be an FAQ, wouldn't it make sense to have these rpm's as depends for the R rpm? (I always compile from source, so don't know what the R rpm actually depends on.) Best, Andy > From: Peter Dalgaard > > "Kevin Bartz" <[EMAIL PROTECTED]> writes: > > > Hello! I'm trying to install R-1.9.1a with readline on Suse > Linux. As > > recommended in other posts, I've installed readline and > readline-devel: > ... > > [EMAIL PROTECTED]:~/R-1.9.1> rpm -qa | grep readline > > > > readline-devel-32bit-9.0-0 > > > > readline-32bit-9.0-0 > > > > readline-4.3-207 > > > > readline-devel-4.3-207 > > ... > > configure:21307: gcc -o conftest -g -O2 -I/usr/local/include > > -L/usr/local/lib conftest.c \ > > > > -lreadline -ldl -lm >&5 > > > > /usr/local/lib/libreadline.so: undefined reference to `tgetnum' > > > > /usr/local/lib/libreadline.so: undefined reference to `tgoto' > > > > /usr/local/lib/libreadline.so: undefined reference to `tgetflag' > > > > /usr/local/lib/libreadline.so: undefined reference to `BC' > > > > /usr/local/lib/libreadline.so: undefined reference to `tputs' > > > > /usr/local/lib/libreadline.so: undefined reference to `PC' > > > > /usr/local/lib/libreadline.so: undefined reference to `tgetent' > > > > /usr/local/lib/libreadline.so: undefined reference to `UP' > > > > /usr/local/lib/libreadline.so: undefined reference to `tgetstr' > ... > > > Any ideas? Thanks for any help you can provide. > > Missing ncurses or ncurses-devel, I believe. > > -- >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 > > __ [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] Readline on R-1.9.1a
"Kevin Bartz" <[EMAIL PROTECTED]> writes: > Hello! I'm trying to install R-1.9.1a with readline on Suse Linux. As > recommended in other posts, I've installed readline and readline-devel: ... > [EMAIL PROTECTED]:~/R-1.9.1> rpm -qa | grep readline > > readline-devel-32bit-9.0-0 > > readline-32bit-9.0-0 > > readline-4.3-207 > > readline-devel-4.3-207 ... > configure:21307: gcc -o conftest -g -O2 -I/usr/local/include > -L/usr/local/lib conftest.c \ > > -lreadline -ldl -lm >&5 > > /usr/local/lib/libreadline.so: undefined reference to `tgetnum' > > /usr/local/lib/libreadline.so: undefined reference to `tgoto' > > /usr/local/lib/libreadline.so: undefined reference to `tgetflag' > > /usr/local/lib/libreadline.so: undefined reference to `BC' > > /usr/local/lib/libreadline.so: undefined reference to `tputs' > > /usr/local/lib/libreadline.so: undefined reference to `PC' > > /usr/local/lib/libreadline.so: undefined reference to `tgetent' > > /usr/local/lib/libreadline.so: undefined reference to `UP' > > /usr/local/lib/libreadline.so: undefined reference to `tgetstr' ... > Any ideas? Thanks for any help you can provide. Missing ncurses or ncurses-devel, I believe. -- 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] Readline on R-1.9.1a
If you've got the required rpm's installed (and they install in the usual locations), you should not need the --with-readline flag. Try running configure with out it. -roger Kevin Bartz wrote: Hello! I'm trying to install R-1.9.1a with readline on Suse Linux. As recommended in other posts, I've installed readline and readline-devel: [EMAIL PROTECTED]:~/R-1.9.1> rpm -qa | grep readline readline-devel-32bit-9.0-0 readline-32bit-9.0-0 readline-4.3-207 readline-devel-4.3-207 Then I run configure with readline: ./configure --with-readline The relevant lines are: [EMAIL PROTECTED]:~/R-1.9.1> ./configure --with-readline | grep readline checking for rl_callback_read_char in -lreadline... no checking readline/history.h usability... yes checking readline/history.h presence... yes checking for readline/history.h... yes checking readline/readline.h usability... yes checking readline/readline.h presence... yes checking for readline/readline.h... yes In config.log all readline tests pass except this one: configure:21277: checking for rl_callback_read_char in -lreadline configure:21307: gcc -o conftest -g -O2 -I/usr/local/include -L/usr/local/lib conftest.c \ -lreadline -ldl -lm >&5 /usr/local/lib/libreadline.so: undefined reference to `tgetnum' /usr/local/lib/libreadline.so: undefined reference to `tgoto' /usr/local/lib/libreadline.so: undefined reference to `tgetflag' /usr/local/lib/libreadline.so: undefined reference to `BC' /usr/local/lib/libreadline.so: undefined reference to `tputs' /usr/local/lib/libreadline.so: undefined reference to `PC' /usr/local/lib/libreadline.so: undefined reference to `tgetent' /usr/local/lib/libreadline.so: undefined reference to `UP' /usr/local/lib/libreadline.so: undefined reference to `tgetstr' collect2: ld returned 1 exit status configure:21313: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "R" | #define PACKAGE_TARNAME "R" | #define PACKAGE_VERSION "1.9.1" | #define PACKAGE_STRING "R 1.9.1" | #define PACKAGE_BUGREPORT "[EMAIL PROTECTED]" | #define PACKAGE "R" | #define VERSION "1.9.1" | #define R_PLATFORM "x86_64-unknown-linux-gnu" | #define R_CPU "x86_64" | #define R_VENDOR "unknown" | #define R_OS "linux-gnu" | #define Unix 1 | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DLFCN_H 1 | #define HAVE_LIBM 1 | #define HAVE_LIBDL 1 | /* end confdefs.h. */ | | /* Override any gcc2 internal prototype to avoid an error. */ | #ifdef __cplusplus | extern "C" | #endif | /* We use char because int might match the return type of a gcc2 |builtin and then its argument prototype would still apply. */ | char rl_callback_read_char (); | int | main () | { | rl_callback_read_char (); | ; | return 0; | } configure:21338: result: no Any ideas? Thanks for any help you can provide. Kevin Bartz [[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 -- Roger D. Peng http://www.biostat.jhsph.edu/~rpeng __ [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] load function to R GUI
Thanks! That was exactly what I wanted. Evgueni Ko-Kang Kevin Wang wrote: Hi, -Original Message- From: [EMAIL PROTECTED] Hi all! I looked through the manual and FAQ, and did not find any information on how to load functions from files (with .R extension) to run them in R GUI under Windows. The only way I know is to create and edit a function inside GUI. But what if I want to edit it in Emacs (do not want to use ESS) and then load into GUI? Any suggestions... Do you mean ?source? i.e. save your function in, say, foo.R then use the source() function to get it in. HTH Kevin __ [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] How to 'stamp' a plot with meta-data?
Itay Furman wrote: Dear R users, Sometimes, for tracking purposes, I am interested to add to a plot some metadata such as * the date it was produced * filename that stores the plot * perhaps data sources, author, etc Ideally, I would like to be able to do this for any kind of plot, plot(), barplot(), hist(), etc.; and, to be able to produce plots with or without the metadata by a simple toggle mechanism. Something like: # 'Clean' plot some.plot.func()# plot() or barplot() or ... # Now with metadata options(metadata=TRUE) # Or some other toggle mechanism some.plot.func() # Same plot as above, but with wider # bottom margins that show the # metadata. So far I looked in "Introduction to R" and tried to find hints using help.search() without success. Is it possilbe to do? Any suggestions or pointers as to how to do it are appreciated. Even partial solution in which the plot is set up to accomodate metadata in the margins, but the data needs to be added manually after plot()ting will be great. Thanks in advance, Itay -- [EMAIL PROTECTED] Fred Hutchinson Cancer Research Center Take a look at the pstamp function in the Hmisc package. -- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University __ [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] load function to R GUI
Hi, > -Original Message- > From: [EMAIL PROTECTED] > Hi all! > I looked through the manual and FAQ, and did not find any information > on how to load functions from files (with .R extension) to run them in > R GUI under Windows. The only way I know is to create and edit a > function inside GUI. But what if I want to edit it in Emacs (do not > want to use ESS) and then load into GUI? > Any suggestions... Do you mean ?source? i.e. save your function in, say, foo.R then use the source() function to get it in. HTH Kevin __ [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] load function to R GUI
Hi all! I looked through the manual and FAQ, and did not find any information on how to load functions from files (with .R extension) to run them in R GUI under Windows. The only way I know is to create and edit a function inside GUI. But what if I want to edit it in Emacs (do not want to use ESS) and then load into GUI? Any suggestions... Evgueni __ [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] How to 'stamp' a plot with meta-data?
Dear R users, Sometimes, for tracking purposes, I am interested to add to a plot some metadata such as * the date it was produced * filename that stores the plot * perhaps data sources, author, etc Ideally, I would like to be able to do this for any kind of plot, plot(), barplot(), hist(), etc.; and, to be able to produce plots with or without the metadata by a simple toggle mechanism. Something like: # 'Clean' plot some.plot.func() # plot() or barplot() or ... # Now with metadata options(metadata=TRUE) # Or some other toggle mechanism some.plot.func() # Same plot as above, but with wider # bottom margins that show the # metadata. So far I looked in "Introduction to R" and tried to find hints using help.search() without success. Is it possilbe to do? Any suggestions or pointers as to how to do it are appreciated. Even partial solution in which the plot is set up to accomodate metadata in the margins, but the data needs to be added manually after plot()ting will be great. Thanks in advance, Itay -- [EMAIL PROTECTED] Fred Hutchinson Cancer Research Center __ [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] extracting p-value of aov F-statistic
> > I would like to extract the p-value of the F-statistic of a aov-object's > > summary. > > > > Getting the p-value is so easy with t-tests (t.test(g1, y = g2, > > var.equal = FALSE)$p.value), but I couldn't find anything like that for > > ANOVAs. > Maybe something like: > >?summary.aov > will give you a clue Unfortunately not. I already checked summary, aov and lm help pages. Sven __ [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] Readline on R-1.9.1a
Hello! I'm trying to install R-1.9.1a with readline on Suse Linux. As recommended in other posts, I've installed readline and readline-devel: [EMAIL PROTECTED]:~/R-1.9.1> rpm -qa | grep readline readline-devel-32bit-9.0-0 readline-32bit-9.0-0 readline-4.3-207 readline-devel-4.3-207 Then I run configure with readline: ./configure --with-readline The relevant lines are: [EMAIL PROTECTED]:~/R-1.9.1> ./configure --with-readline | grep readline checking for rl_callback_read_char in -lreadline... no checking readline/history.h usability... yes checking readline/history.h presence... yes checking for readline/history.h... yes checking readline/readline.h usability... yes checking readline/readline.h presence... yes checking for readline/readline.h... yes In config.log all readline tests pass except this one: configure:21277: checking for rl_callback_read_char in -lreadline configure:21307: gcc -o conftest -g -O2 -I/usr/local/include -L/usr/local/lib conftest.c \ -lreadline -ldl -lm >&5 /usr/local/lib/libreadline.so: undefined reference to `tgetnum' /usr/local/lib/libreadline.so: undefined reference to `tgoto' /usr/local/lib/libreadline.so: undefined reference to `tgetflag' /usr/local/lib/libreadline.so: undefined reference to `BC' /usr/local/lib/libreadline.so: undefined reference to `tputs' /usr/local/lib/libreadline.so: undefined reference to `PC' /usr/local/lib/libreadline.so: undefined reference to `tgetent' /usr/local/lib/libreadline.so: undefined reference to `UP' /usr/local/lib/libreadline.so: undefined reference to `tgetstr' collect2: ld returned 1 exit status configure:21313: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME "R" | #define PACKAGE_TARNAME "R" | #define PACKAGE_VERSION "1.9.1" | #define PACKAGE_STRING "R 1.9.1" | #define PACKAGE_BUGREPORT "[EMAIL PROTECTED]" | #define PACKAGE "R" | #define VERSION "1.9.1" | #define R_PLATFORM "x86_64-unknown-linux-gnu" | #define R_CPU "x86_64" | #define R_VENDOR "unknown" | #define R_OS "linux-gnu" | #define Unix 1 | #ifdef __cplusplus | extern "C" void std::exit (int) throw (); using std::exit; | #endif | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DLFCN_H 1 | #define HAVE_LIBM 1 | #define HAVE_LIBDL 1 | /* end confdefs.h. */ | | /* Override any gcc2 internal prototype to avoid an error. */ | #ifdef __cplusplus | extern "C" | #endif | /* We use char because int might match the return type of a gcc2 |builtin and then its argument prototype would still apply. */ | char rl_callback_read_char (); | int | main () | { | rl_callback_read_char (); | ; | return 0; | } configure:21338: result: no Any ideas? Thanks for any help you can provide. Kevin Bartz [[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] error running sammon
Which package is the sammon() you are using in? (There such functions in TWO packages.) On Mon, 14 Jun 2004, Greg Blevins wrote: > Hello, > > I am inputing a 17 x 17 symetric matrix to sammon. The matrix is a > co-occurance matrix with no missing data. If this is at all relevant, > running hclust on this matrix works. > > > samx <- sammon(q23axproduct) > > I receive the following error: > > Error in sammon(q23axproduct) : initial configuration must be complete > > In addition: Warning messages: > > 1: some of the first 2 eigenvalues are < 0 in: cmdscale(d, k) > > 2: NaNs produced in: sqrt(ev) > > > > > Any suggestions of what is happening and how to rectify this? > > Thanks > > Gregory L. Blevins > > The Market Solutions Group > > [[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 > > -- 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] Coercing a dataframe column to datetime
You have forgotten as.POSIXct is needed too. On Mon, 14 Jun 2004 [EMAIL PROTECTED] wrote: > I am trying to coerce a data frame column from character to datetime using strptime > but keep getting an error because the length of the coerced object is always 9. > What am I doing wrong here: > > . > > ds <- cbind(1:2, c("02/27/92 23:03:20", "02/27/92 22:29:56")); ds > [,1] [,2] > [1,] "1" "02/27/92 23:03:20" > [2,] "2" "02/27/92 22:29:56" > > > > q <- strptime(ds[,2], "%m/%d/%y %H:%M:%S"); q > [1] "1992-02-27 23:03:20" "1992-02-27 22:29:56" > > > > ds[,2] <- q > Error in "[<-"(`*tmp*`, , 2, value = q) : number of items to replace is not a > multiple of replacement length > > > > length(q) > [1] 9 > > . > > --Rich > > Richard Kittler > AMD TDG > 408-749-4099 > > __ > [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 > > -- 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] mkChar can be interrupted
Hi, As was discussed earlier in another thread and as documented in R-exts .Call() should not be interruptible by Ctrl-C. However the following code, which spends most of its time inside mkChar, turned out to be interruptible on RH-7.3 R-1.8.1 gcc-2.96: #include #include SEXP foo0(const SEXP nSexp) { int i, n; SEXP resSexp; if (!isInteger(nSexp)) error("wrong arg type\n"); n = asInteger(nSexp); resSexp = PROTECT(allocVector(STRSXP, n)); Rprintf("!!!time to interrup!!!\n"); for (i=0; i x <- .Call("foo0", as.integer(1e7)) !!!time to interrup!!! > > 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 Thanks, Vadim __ [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] interrupt in Linux
Does anyone know how to interrupt R in RedHat? Neither control-c nor Esc is working. What I don't want to do is close the window or kill the entire R process. Thanks, David Try Ctrl-Z and then to relunch it with %R from the shell-prompt. Ciao, -A. Armin Roehrl, http://www.approximity.com We manage risk Blogs: http://blog.approximity.com http://agile.approximity.com __ [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] Coercing a dataframe column to datetime
I am trying to coerce a data frame column from character to datetime using strptime but keep getting an error because the length of the coerced object is always 9. What am I doing wrong here: . > ds <- cbind(1:2, c("02/27/92 23:03:20", "02/27/92 22:29:56")); ds [,1] [,2] [1,] "1" "02/27/92 23:03:20" [2,] "2" "02/27/92 22:29:56" > > q <- strptime(ds[,2], "%m/%d/%y %H:%M:%S"); q [1] "1992-02-27 23:03:20" "1992-02-27 22:29:56" > > ds[,2] <- q Error in "[<-"(`*tmp*`, , 2, value = q) : number of items to replace is not a multiple of replacement length > > length(q) [1] 9 . --Rich Richard Kittler AMD TDG 408-749-4099 __ [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] interrupt in Linux
Does anyone know how to interrupt R in RedHat? Neither control-c nor Esc is working. What I don't want to do is close the window or kill the entire R process. Thanks, David 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
[R] error running sammon
Hello, I am inputing a 17 x 17 symetric matrix to sammon. The matrix is a co-occurance matrix with no missing data. If this is at all relevant, running hclust on this matrix works. > samx <- sammon(q23axproduct) I receive the following error: Error in sammon(q23axproduct) : initial configuration must be complete In addition: Warning messages: 1: some of the first 2 eigenvalues are < 0 in: cmdscale(d, k) 2: NaNs produced in: sqrt(ev) > Any suggestions of what is happening and how to rectify this? Thanks Gregory L. Blevins The Market Solutions Group [[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] error with barplot command?
On Tue, 15 Jun 2004 01:40:49 +0800, »ÆÈÙ¹ó <[EMAIL PROTECTED]> wrote : >when i use barplot ,it seems there is sth wrong with it. >my command are: >> beer = scan() >1: 3 4 1 1 3 4 3 3 1 3 2 1 2 1 2 3 2 3 1 1 1 1 4 3 1 >26: >Read 25 items >> barplot(table(beer)) > >but it does NOT produce what i want. Please try 1.9.1 beta. This should be fixed now... The beta builds for Windows are available on CRAN in /bin/windows/base, where they are called "patch releases". Right now the build that's online is 5 days old, but today's build should be online tomorrow. Source code (at least) is available for other platforms from the main page. 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
[R] Clear Console
Hi, Could someone please point to me which function clears the R console under Windows? (exactly what the R Gui Windows menu "Edit > Clear Console" does). Seems simple but I haven't been succesful with the help system (help.search for "console", "clear console", "screen"...) nor on the list archives. Thanks in advance!! Enrique __ [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] extracting p-value of aov F-statistic
At 10:11 AM 6/14/2004, Sven Hartenstein wrote: >Hi, > >I would like to extract the p-value of the F-statistic of a aov-object's >summary. > >Getting the p-value is so easy with t-tests (t.test(g1, y = g2, >var.equal = FALSE)$p.value), but I couldn't find anything like that for >ANOVAs. > >Any help appreciated, > Maybe something like: >?summary.aov will give you a clue __ [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] Clustalw again
Hi Daniela! I understand it right? You want to compute an multiple alignment of 37000 sequences at once? There are no multiple alignment programs in the world that can compute a multiple alignment of 37000 sequences to my knowledge. Sincerely Eryk. Ps. What you can try is to cluster the sequences according their pairwise sequence alignment and compute multiple alignments for similar sequences. But you will need a fast algorithm like BLAST algorithm and this on to on is not implemented in R. *** REPLY SEPARATOR *** On 14.06.2004 at 17:39 [EMAIL PROTECTED] wrote: >Hi, >I try to have again some tips about clustalw function (in dna package). >I try to use this function on a windos platform, but my pc doesn`t have >enough memory(512 Mb) for allocation, analizing a file with more or less >37250 sequences , so i try on a linux platform and every time i have a >segmentation fault!! >What is the problem?Do you think that also on linux platform memory is the >problem (1Gb)? >Thanks agin > >__ >[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] error with barplot command?
when i use barplot ,it seems there is sth wrong with it. my command are: > beer = scan() 1: 3 4 1 1 3 4 3 3 1 3 2 1 2 1 2 3 2 3 1 1 1 1 4 3 1 26: Read 25 items > barplot(table(beer)) but it does NOT produce what i want. > version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major1 minor9.0 year 2004 month04 day 12 language R btw:i get what i want in R1.8.1pat __ [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] extracting p-value of aov F-statistic
Hi, I would like to extract the p-value of the F-statistic of a aov-object's summary. Getting the p-value is so easy with t-tests (t.test(g1, y = g2, var.equal = FALSE)$p.value), but I couldn't find anything like that for ANOVAs. Any help appreciated, Sven __ [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] forecasting from fracdiff objects
> "Alan" == Alan Simpson <[EMAIL PROTECTED]> > on Mon, 14 Jun 2004 12:36:58 +0800 writes: Alan> Does anybody know if it is possible to forcast or predict from a Alan> fracdiff object? yes, it is possible but not (yet?) with a builtin function, but rather by writing code to do it --- using the fracdiff() result *and* the data from which you want to make h-ahead predictions (which I assume is what you want). At the moment, there's not even residuals() or fitted() methods available for fracdiff objects. At least those are really just an exercise to implement (which might not be true for the h-ahead predictions: There you'd probably need a version of the Durbin-Lewinson or the innovations algorithm). User contributions are very welcome... ;-) Martin Maechler <[EMAIL PROTECTED]> http://stat.ethz.ch/~maechler/ Seminar fuer Statistik, ETH-Zentrum LEO C16Leonhardstr. 27 ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND phone: x-41-1-632-3408 fax: ...-1228 <>< __ [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] A Few MCLUST Questions
Hi Ken, 1) me starting with a partition converges toward the same result as em starting with the parameters associated with the partition. So there is no point in doing both and see which one is better. 2) hc is an agglomerative hierarchical method. This means, it starts with n clusters and reduces the number of clusters by 1 in every step. That is, if you want to compute the solution for G=2 clusters, you *have to* compute n, n-1, n-2,..., G+1 clusters first. By definition, it's not possible to calculate 2, but not more clusters. Christian On Sun, 13 Jun 2004, [EMAIL PROTECTED] wrote: > > Hello everyone. I have a few MCLUST questions and I was hoping someone could help me > out. If youre an MCLUST user, they will likely be pretty easy to answer. Thanks in > advance for any help. > > Ken > > > >What are the pros/cons of starting a finite mixture model at the m step versus > the e step (where m is the maximization step and e is the expectation step of > the EM algorithm)? In particular, are there any reasons for using em(modelName=XXX) > versus me(modelName=XXX). Other than MCLUST, Ive not seen a finite mixture model > program give such an option. Would it make sense to fit both models and take the > one with the largest log likelihood? > > > >Rather than the hc() function performing cluster analysis for all of G possible > clusters, can it be set to only perform a specified number (e.g., set so G=2 only). > Although a minimum number of clusters can be specified, there doesnt seem to be any > way to limit the number of clusters. I want to do a simulation for a fixed number of > components, and thus I would like to avoid the unnecessary computations. > > > >Is there any difference between hc(modelName=VVV) and hcVVV or hc(modelName=EEE) > and hcEEE, etc.? Likewise, are there any differences between mstep(modelName=VVV) > and mstepVVV or mstep(modelName=EEE) and mstepEEE, etc. If not, why do the same > functions have different names? > > > > - > > > [[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 > *** Christian Hennig Fachbereich Mathematik-SPST/ZMS, Universitaet Hamburg [EMAIL PROTECTED], http://www.math.uni-hamburg.de/home/hennig/ ### ich empfehle www.boag-online.de __ [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] Clustalw again
Hi, I try to have again some tips about clustalw function (in dna package). I try to use this function on a windos platform, but my pc doesn`t have enough memory(512 Mb) for allocation, analizing a file with more or less 37250 sequences , so i try on a linux platform and every time i have a segmentation fault!! What is the problem?Do you think that also on linux platform memory is the problem (1Gb)? Thanks agin __ [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] .Traceback
Thanks a lot! of course the assignment myvar<-.Traceback is all what I need. Eryk *** REPLY SEPARATOR *** On 14.06.2004 at 10:53 Duncan Murdoch wrote: >On Mon, 14 Jun 2004 16:38:48 +0200, "Wolski" <[EMAIL PROTECTED]> >wrote : > >>Hi! >> >>Is there a way to write the information stored in the .Traceback variable >to a file? >> >>When I try it with dump() >>".Traceback" <- >>list("dump(.Traceback, file = \"Mytraceback.R\")") >> >>Or there are other ways to write this information on the disk if an error >occurs? > >dump() is usually used when you want to recreate the object. Here, >you probably just want to print it, so something like > >sink('error.txt') >traceback() >sink() > >might do a better job. But if you really want the .Traceback list, I >think you just need to assign it to a new variable before dumping, >e.g. > >saveTrace <- .Traceback >dump('saveTrace', 'whereever.R') > >I imagine the problem you're having is from some special case code to >handle the .Traceback variable in a dump, but I haven't checked the >source to see. > >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 __ [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] .Traceback
On Mon, 14 Jun 2004 16:38:48 +0200, "Wolski" <[EMAIL PROTECTED]> wrote : >Hi! > >Is there a way to write the information stored in the .Traceback variable to a file? > >When I try it with dump() >".Traceback" <- >list("dump(.Traceback, file = \"Mytraceback.R\")") > >Or there are other ways to write this information on the disk if an error occurs? dump() is usually used when you want to recreate the object. Here, you probably just want to print it, so something like sink('error.txt') traceback() sink() might do a better job. But if you really want the .Traceback list, I think you just need to assign it to a new variable before dumping, e.g. saveTrace <- .Traceback dump('saveTrace', 'whereever.R') I imagine the problem you're having is from some special case code to handle the .Traceback variable in a dump, but I haven't checked the source to see. 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] .Traceback
"Wolski" <[EMAIL PROTECTED]> writes: > Hi! > > Is there a way to write the information stored in the .Traceback variable to a file? > > When I try it with dump() > ".Traceback" <- > list("dump(.Traceback, file = \"Mytraceback.R\")") > > Or there are other ways to write this information on the disk if an error occurs? You can assign it to a variable of a different name and save that. I suspect that is the only way. E.g., f <- function() foo() lm(y~x,data=f()) # lazy evaluation makes this interesting x <- .Traceback dput(x) # or dump("x"), or save(), or -- 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] adjusting color palette
On Mon, 14 Jun 2004, Laura Quinn wrote: > Is there a way to increase the "sensitivity" of the color palette in order > to more clearly represent certain sections of data? For example I am > wanting to clearly differentiate between height data for a rolling > landscape but because of the extremes of the dataset (sea and mountain > tops), the bulk of the landscape is shaded in closely approximating green > - i have attempted to do this by using a larger color palette but this > doesn't make things any clearer. It sounds as though you are using topo.colors() to generate the palette. Perhaps the simplest approach is to generate a large palette and then subsample from it. Eg topo.colors(20)[c(1:5,7,9,11,13,15:20)] will produce more widely spaced colors in the middle of the palette. -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
[R] .Traceback
Hi! Is there a way to write the information stored in the .Traceback variable to a file? When I try it with dump() ".Traceback" <- list("dump(.Traceback, file = \"Mytraceback.R\")") Or there are other ways to write this information on the disk if an error occurs? Eryk __ [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] Matrix_0.8-8 and norm() function
Costas Vorlow wrote: Hello and apologies if this is a stupid question (just rejoined the list): Has anything changed with the norm() function with the latest update of the Matrix library? My old code seems not to be working properly even for very simple tests of the norm function. I get too many "No direct or inherited method for function "norm" for this call" messages. I am using windows, R 1.9.0 and the Rblas.dll linked against version 3.4.1 of the ATLAS library. Thanks for your time, Costas Well, a lot has changed in the Matrix package. Could you send me, perhaps off-list, a sample of your use of norm? __ [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] Matrix_0.8-8 and norm() function
Hello and apologies if this is a stupid question (just rejoined the list): Has anything changed with the norm() function with the latest update of the Matrix library? My old code seems not to be working properly even for very simple tests of the norm function. I get too many "No direct or inherited method for function "norm" for this call" messages. I am using windows, R 1.9.0 and the Rblas.dll linked against version 3.4.1 of the ATLAS library. Thanks for your time, Costas -- This e-mail contains information intended for the addressee only. It may be confidential and may be the subject of legal and/or professional Privilege. Any dissemination, distribution, copyright or use of this communication without prior permission of the addressee is strictly prohibited. --- Dr. Costas Vorlow | Tel: +44 (0)191 33 45727 Durham Business School | Fax: +44 (0)191 33 45201 Room (126), University of Durham, | email: [EMAIL PROTECTED] Mill Hill Lane,| or : [EMAIL PROTECTED] Durham DH1 3LB, UK.| http://www.vorlow.org Fingerprint: B010 577A 9EC3 9185 08AE 8F22 1A48 B4E7 9FA6 C31A "How empty is theory in presence of fact!" (Mark Twain, 1889) __ [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] terminology for frames and environments
On Mon, 14 Jun 2004, John Maindonald wrote: > > I have found it helpful, in trying to explain (to myself and others) > what happens, to say that there is both a lexical stack and a call > stack. Is that a legitimate use of terminology? > I think this is helpful, despite being inaccurate. If you also recognise that there are multiple "lexical stacks" then it is an even better approximation. Regarding "parent", the problem is that in S the term "parent frame" was used, quite reasonably, for the calling frame, resulting in the function sys.parent(). Backwards (?sideways) compatibility requires that sys.parent() exist in R and return a position in the calling stack, and this led to parent.frame() as a shortcut for sys.frame(sys.parent()). Unfortunately in R, "parent" would more logically refer to the lexical parent, which is the rationale for parent.env(). That's why the situation is a mess. I think the standard, given these contradictions, is "enclosing environment" for the lexical parent "parent environment" for the thing returned by parent.frame() and that's what the FAQ uses in discussing scoping. The distinction between "environment" and "frame" is important. The frame is what you find things in with get(, inherits=FALSE) and the environment uses get(, environment=TRUE). In almost all sitations you can just think of a calling stack and a lexical stack, and ignore the frame/environment distinction. You do need to be aware that this is an abuse of notation, because it does sometimes matter. -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] adjusting color palette
On Mon, 14 Jun 2004 07:14:46 -0700, Don MacQueen <[EMAIL PROTECTED]> wrote : >See also > > ?pallete Typo: it should be ?palette. 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] adjusting color palette
See also ?pallete with which you can make your pallete be anything you want. The examples given there will point you to several pre-defined palletes. Perhaps one of them will do a better job for you than whatever you're trying now. rainbow(n, s = 1, v = 1, start = 0, end = max(1,n - 1)/n, gamma = 1) heat.colors(n) terrain.colors(n) topo.colors(n) cm.colors(n) -Don At 1:08 PM +0100 6/14/04, Laura Quinn wrote: Is there a way to increase the "sensitivity" of the color palette in order to more clearly represent certain sections of data? For example I am wanting to clearly differentiate between height data for a rolling landscape but because of the extremes of the dataset (sea and mountain tops), the bulk of the landscape is shaded in closely approximating green - i have attempted to do this by using a larger color palette but this doesn't make things any clearer. Thanks Laura __ [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 -- -- Don MacQueen Environmental Protection Department Lawrence Livermore National Laboratory Livermore, CA, USA __ [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] Quirks with system.time and simulations
On Mon, 14 Jun 2004, Patrick Connolly wrote: > > It seems as though the first simulation makes it "easier" for > subsequent simulations of the same type AND also for simulations of a > somewhat different type also. The degree to which it "helps" varies > according to just what is being run (no surprise there). What I can't > figure out is what is happening that makes it quicker for second and > subsequent runs. > Luke Tierney would be the person most likely to have a definitive answer, but my guess is that it is because of the generational garbage collector. When this was added the speed of R improved about 20%, and the main reason is that most garbage collections involve only recently allocated memory. One effect is that memory blocks tend to get reused for the same objects in later iterations of the simulation, which is more efficient. For the second simulation the gains are smaller. Possibly a more accurate benchmark would be something like Rprof("timing.prof") replicate(LOTS, {oneway(); otherway()}) Rprof(NULL) summaryRprof("timing.prof") interleaving the two methods. -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] terminology for frames and environments
Gabor Grothendieck <[EMAIL PROTECTED]> writes: > : > We have been approaching consensus on a couple of occasions, but > : > (obviously) not been too good at enforcing it. I think the consensus > : > is that a "frame" is a set of variable bindings (implemented as a > : > hashed list), an environment is a frame plus an enclosing environment, > : > i.e. a linked list of frames, terminated by NULL. It is occasionally > : > necessary to refer to the individual frames as opposed to the whole > : > list, which is exactly the point of the inherits argument. > Regarding Peter's comment, I would prefer to keep referring to an > environment as an object of class "environment" namely what > new.env creates, parent.env changes, is.environment > queries, etc. so that R does not need a massive change. > > In that case I guess: > > - frame and environment are synonyms No. Please read what I wrote again. > - enclosing environment is an environment together with its lexical ancestors No. It *is* the lexical ancestor(s). > - the parent without further qualification is the lexical parent No. (In particular, sys.parent() is not) > - the caller or call parent is the environment one higher up on call stack ...which is a tree! and the parent caller is not necessarily the one one step above in the *context* stack. (Go play with sys.status() until you understand this.) > - an ordered set of environments can be used to refer to either the > call stack, an environment and its ancestors or other ordered set of > environments Er, what do you mean by that...??? -- 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] Modifying Code in .rda based packages (e.g. lme4)
Prof Brian Ripley wrote: No standard R package is supplied as a .rda, including not lme4. You must be looking at a binary installation, and you would do best to reinstall from the sources. You could use R --vanilla load("/all.rda") fix(GLMM) save(ls(all=T), file="/all.rda", compress = TRUE) q() but we would not recommend it. Indeed, we do not recommend your altering functions in other people's packages. Why not just make a copy of GLMM with another name and alter that? On Fri, 11 Jun 2004, Dieter Menne wrote: assume I want to make a minor local change in a package that is supplied as .rda. For example, I want to get rid of the non-verbose-protected "Iteration" message in GLMM/lme4. Probably I have to load / change / save the package, but could someone help me to get the syntax right? I think, saving need to be done with save(list=ls(all=T), file="/all.rda", compress = TRUE) otherwise R complains about Object "ls(all = T)" not found (the '...' argument comes first in the 'save' argument list) __ [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] adjusting color palette
Laura Quinn wrote: Is there a way to increase the "sensitivity" of the color palette in order to more clearly represent certain sections of data? For example I am wanting to clearly differentiate between height data for a rolling landscape but because of the extremes of the dataset (sea and mountain tops), the bulk of the landscape is shaded in closely approximating green - i have attempted to do this by using a larger color palette but this doesn't make things any clearer. The colour is selected linearly by the value you are drawing. Hence two solutions present themselves: one, non-linearly scale your data. for your application I think squaring x-mean(x) might stretch out the tails. two, constructing a non-linearly varying palette. you can do this by mucking about with the red, green, and blue values from the palette. the functions 'col2rgb' and 'rgb' are useful. Baz __ [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] terminology for frames and environments
John Maindonald anu.edu.au> writes: : : > From: Peter Dalgaard biostat.ku.dk> : > Date: 14 June 2004 5:42:29 PM : > : > "Gabor Grothendieck" myway.com> writes: : : >> ... : >> Could someone please clarify what standard terminology is? : > : > Not sure there is one... : > : > We have been approaching consensus on a couple of occasions, but : > (obviously) not been too good at enforcing it. I think the consensus : > is that a "frame" is a set of variable bindings (implemented as a : > hashed list), an environment is a frame plus an enclosing environment, : > i.e. a linked list of frames, terminated by NULL. It is occasionally : > necessary to refer to the individual frames as opposed to the whole : > list, which is exactly the point of the inherits argument. : > : > Notice that exists() talks about "enclosing" which is only ever used : > in sense #1 above. "parent" is used in both senses (which is a bit : > unfortunate -- not quite sure whether we have decided to get rid of : > parent.env() eventually). : > : I have found it helpful, in trying to explain (to myself and others) : what happens, to say that there is both a lexical stack and a call : stack. Is that a legitimate use of terminology? I would not use the term "stack" for the lexical one since, in that case, the graph is not linear and not even connected although for any particular environment (in the sense of an object with class "environment") that environment and its lexical ancestors form a linear structure. Regarding Peter's comment, I would prefer to keep referring to an environment as an object of class "environment" namely what new.env creates, parent.env changes, is.environment queries, etc. so that R does not need a massive change. In that case I guess: - frame and environment are synonyms - enclosing environment is an environment together with its lexical ancestors - the parent without further qualification is the lexical parent - the caller or call parent is the environment one higher up on call stack - an ordered set of environments can be used to refer to either the call stack, an environment and its ancestors or other ordered set of environments __ [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] adjusting color palette
Laura Quinn wrote: Is there a way to increase the "sensitivity" of the color palette in order to more clearly represent certain sections of data? For example I am wanting to clearly differentiate between height data for a rolling landscape but because of the extremes of the dataset (sea and mountain tops), the bulk of the landscape is shaded in closely approximating green - i have attempted to do this by using a larger color palette but this doesn't make things any clearer. Thanks Laura See ?hsv. If you need more sophisticated stuff, you might want to try out the package "RColorBrewer". 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
[R] adjusting color palette
Is there a way to increase the "sensitivity" of the color palette in order to more clearly represent certain sections of data? For example I am wanting to clearly differentiate between height data for a rolling landscape but because of the extremes of the dataset (sea and mountain tops), the bulk of the landscape is shaded in closely approximating green - i have attempted to do this by using a larger color palette but this doesn't make things any clearer. Thanks Laura __ [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] Piecharts in a graph
M. Shiham Adam wrote: Dear R-Community. I am trying show pie charts on a graph. To be precise, I have series of catch calues by species by geographic (5 deg by 5 deg) regions. I want to draw circles (actually pie charts showing the proportion of the catch in each area) so that I have a graph of catch by species by geographic area! I know there is the < symbols(dat$lon,dat$lat,circles = dat$sp1, add=TRUE) > but I need pie charts instead of the simple circle! Here is some data Examples can be found, e.g., in @Article{Rnews:Murrell:2003, author = {Paul Murrell}, title= {Integrating grid Graphics Output with Base Graphics Output }, journal = {R News}, year = 2003, volume = 3, number = 2, pages= {7--12}, month= {October}, url = {http://CRAN.R-project.org/doc/Rnews/} } and Paul's talk at the useR! (Slides available at http://www.ci.tuwien.ac.at/Conferences/useR-2004/Keynotes/Murrell.pdf). Uwe Ligges dat lon lat sp1 sp2 sp3 1 20 50 2 6 10 2 20 55 370 20 23 3 20 60 380 40 23 4 20 65 60 100 87 5 25 50 0 0 98 Any help would be much appreciated Shiham Adam __ [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] terminology for frames and environments
John Maindonald <[EMAIL PROTECTED]> writes: > I have found it helpful, in trying to explain (to myself and others) > what happens, to say that there is both a lexical stack and a call > stack. Is that a legitimate use of terminology? Slightly inaccurate I'd say. Both are actually trees, since multiple calls can have the same parent (due to eval() and lazy evaluation) and multiple environments can share the same enclosing environment. Since the trees are only connected by arrows pointing towards the root, they just *look like* a stack of frames when viewed from one of the branches. The only true stack structure is the context stack, which holds the information on where to return from the current call. -- 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] CVnn2 + nnet question
I have no idea what you are actually doing. When I run the code in the book the output begins fold 1 size = 6 decay = 0.001 inner fold 1 2 3 4 5 and those are the default values. You *have* altered something, and it is not reasonable to expect R-help readers to debug your code (especially not for a commercial user). On Mon, 14 Jun 2004, Manoj - Hachibushu Capital wrote: > Thanks for the prompt reply. I don't think I am using any non default > arguments but still...here is the exact syntax for two different case > (skip = T and default) and the corresponding error message that I > receive. > > > Default Case ("skip = F") > > Syntax: nn.test <- > CVnn2(Y~X1+X2+X3+X4+X5+X6+X7+X8+X9+X10+X11,all.data.norm[1:train.set,],m > axit=500,nreps=10) > > Error message: > Fold 1 > Size = 0 decay = 0 > Inner fold 1Error in nnet.default(x,y,w.) : No > weights to fit. > > > > Case where Skip = T: > > Syntax: nn.test <- > CVnn2(Y~X1+X2+X3+X4+X5+X6+X7+X8+X9+X10+X11,all.data.norm[1:train.set,],m > axit=500,nreps=10,skip=T) > > Error message: > Fold 1 > Size=0 decay = 0 > Inner fold 1Error in switch(type,raw=z,class= { : inappropriate > fit for class > > > Manoj > > -Original Message- > From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] > Sent: Monday, June 14, 2004 8:26 PM > To: Manoj - Hachibushu Capital > Cc: [EMAIL PROTECTED] > Subject: Re: [R] CVnn2 + nnet question > > You are trying to fit a neural network with no connections. That makes > no > sense unless skip=T (as on the page you are quoting). > > On Mon, 14 Jun 2004, Manoj - Hachibushu Capital wrote: > > > Hi, > > I am trying to determine the number of units in the hidden layer > > and the decay rate using the CVnn2 script found in MASS directory > > (reference: pg 348,MASS-4). > > > > The model that I am using is in the form of Y ~ X1 + X2 + X3... > > + X11 and the underlying data is time-series in nature. > > > > I found the MASS and nnet package extremely useful (many thanks > > to the contributors). > > `contributors'? Do see the DESCRIPTION file: it is hardly anonymous > work. > > > However I am getting an error while using the CVnn2 > > function...it says > > You have not shown us the call you used, but the default arguments are > size = rep(6, 2), lambda = c(0.001, 0.01) so you have used non-default > args without telling us what. > > > Fold 1 > > Size = 0, decay = 0, inner fold 1 Error in nnet.default(x,y,w,): > No > > weights to fit. > > > > Obliviously I am doing something wrong but am not able to figure > > it out. > > Please do re-read the basic description of neural nets and nnet(). > > > Do I have pass any weights? I am bit confused since the > > documentation of nnet suggests says "Wts: initial parameter vector. If > > missing chosen at Random". Has anybody faced the same error? I am > using > > the latest R version on Linux box. > > -- 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] CVnn2 + nnet question
Thanks for the prompt reply. I don't think I am using any non default arguments but still...here is the exact syntax for two different case (skip = T and default) and the corresponding error message that I receive. Default Case ("skip = F") Syntax : nn.test <- CVnn2(Y~X1+X2+X3+X4+X5+X6+X7+X8+X9+X10+X11,all.data.norm[1:train.set,],m axit=500,nreps=10) Error message: Fold 1 Size = 0 decay = 0 Inner fold 1Error in nnet.default(x,y,w.) : No weights to fit. Case where Skip = T: Syntax: nn.test <- CVnn2(Y~X1+X2+X3+X4+X5+X6+X7+X8+X9+X10+X11,all.data.norm[1:train.set,],m axit=500,nreps=10,skip=T) Error message: Fold 1 Size=0 decay = 0 Inner fold 1Error in switch(type,raw=z,class= { : inappropriate fit for class Manoj -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Monday, June 14, 2004 8:26 PM To: Manoj - Hachibushu Capital Cc: [EMAIL PROTECTED] Subject: Re: [R] CVnn2 + nnet question You are trying to fit a neural network with no connections. That makes no sense unless skip=T (as on the page you are quoting). On Mon, 14 Jun 2004, Manoj - Hachibushu Capital wrote: > Hi, > I am trying to determine the number of units in the hidden layer > and the decay rate using the CVnn2 script found in MASS directory > (reference: pg 348,MASS-4). > > The model that I am using is in the form of Y ~ X1 + X2 + X3... > + X11 and the underlying data is time-series in nature. > > I found the MASS and nnet package extremely useful (many thanks > to the contributors). `contributors'? Do see the DESCRIPTION file: it is hardly anonymous work. > However I am getting an error while using the CVnn2 > function...it says You have not shown us the call you used, but the default arguments are size = rep(6, 2), lambda = c(0.001, 0.01) so you have used non-default args without telling us what. > Fold 1 > Size = 0, decay = 0, inner fold 1 Error in nnet.default(x,y,w,): No > weights to fit. > > Obliviously I am doing something wrong but am not able to figure > it out. Please do re-read the basic description of neural nets and nnet(). > Do I have pass any weights? I am bit confused since the > documentation of nnet suggests says "Wts: initial parameter vector. If > missing chosen at Random". Has anybody faced the same error? I am using > the latest R version on Linux box. -- 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] Piecharts in a graph
Dear R-Community. I am trying show pie charts on a graph. To be precise, I have series of catch calues by species by geographic (5 deg by 5 deg) regions. I want to draw circles (actually pie charts showing the proportion of the catch in each area) so that I have a graph of catch by species by geographic area! I know there is the < symbols(dat$lon,dat$lat,circles = dat$sp1, add=TRUE) > but I need pie charts instead of the simple circle! Here is some data > dat lon lat sp1 sp2 sp3 1 20 50 2 6 10 2 20 55 370 20 23 3 20 60 380 40 23 4 20 65 60 100 87 5 25 50 0 0 98 Any help would be much appreciated Shiham Adam __ [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] terminology for frames and environments
From: Peter Dalgaard <[EMAIL PROTECTED]> Date: 14 June 2004 5:42:29 PM "Gabor Grothendieck" <[EMAIL PROTECTED]> writes: ... Could someone please clarify what standard terminology is? Not sure there is one... We have been approaching consensus on a couple of occasions, but (obviously) not been too good at enforcing it. I think the consensus is that a "frame" is a set of variable bindings (implemented as a hashed list), an environment is a frame plus an enclosing environment, i.e. a linked list of frames, terminated by NULL. It is occasionally necessary to refer to the individual frames as opposed to the whole list, which is exactly the point of the inherits argument. Notice that exists() talks about "enclosing" which is only ever used in sense #1 above. "parent" is used in both senses (which is a bit unfortunate -- not quite sure whether we have decided to get rid of parent.env() eventually). -- O__ Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 I have found it helpful, in trying to explain (to myself and others) what happens, to say that there is both a lexical stack and a call stack. Is that a legitimate use of terminology? John Maindonald email: [EMAIL PROTECTED] phone : +61 2 (6125)3473fax : +61 2(6125)5549 Centre for Bioinformation Science, Room 1194, John Dedman Mathematical Sciences Building (Building 27) Australian National University, Canberra ACT 0200. __ [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] CVnn2 + nnet question
You are trying to fit a neural network with no connections. That makes no sense unless skip=T (as on the page you are quoting). On Mon, 14 Jun 2004, Manoj - Hachibushu Capital wrote: > Hi, > I am trying to determine the number of units in the hidden layer > and the decay rate using the CVnn2 script found in MASS directory > (reference: pg 348,MASS-4). > > The model that I am using is in the form of Y ~ X1 + X2 + X3... > + X11 and the underlying data is time-series in nature. > > I found the MASS and nnet package extremely useful (many thanks > to the contributors). `contributors'? Do see the DESCRIPTION file: it is hardly anonymous work. > However I am getting an error while using the CVnn2 > function...it says You have not shown us the call you used, but the default arguments are size = rep(6, 2), lambda = c(0.001, 0.01) so you have used non-default args without telling us what. > Fold 1 > Size = 0, decay = 0, inner fold 1 Error in nnet.default(x,y,w,): No > weights to fit. > > Obliviously I am doing something wrong but am not able to figure > it out. Please do re-read the basic description of neural nets and nnet(). > Do I have pass any weights? I am bit confused since the > documentation of nnet suggests says "Wts: initial parameter vector. If > missing chosen at Random". Has anybody faced the same error? I am using > the latest R version on Linux box. -- 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] CVnn2 + nnet question
Hi, I am trying to determine the number of units in the hidden layer and the decay rate using the CVnn2 script found in MASS directory (reference: pg 348,MASS-4). The model that I am using is in the form of Y ~ X1 + X2 + X3... + X11 and the underlying data is time-series in nature. I found the MASS and nnet package extremely useful (many thanks to the contributors). However I am getting an error while using the CVnn2 function...it says Fold 1 Size = 0, decay = 0, inner fold 1 Error in nnet.default(x,y,w,): No weights to fit. Obliviously I am doing something wrong but am not able to figure it out. Do I have pass any weights? I am bit confused since the documentation of nnet suggests says "Wts: initial parameter vector. If missing chosen at Random". Has anybody faced the same error? I am using the latest R version on Linux box. TIA Manoj __ [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] ordering points as vertex of a polygon
On 14-Jun-04 Luca Scrucca wrote: > Dear R-users, > > Suppose I have the following x-y coordinates which give the > boundaries of a polygon: >> x <- c(5,4,5,9,6,6,4,7,10,7,10,4,10) >> y <- c(6,3,2,6,3,7,5,4,4,7, 5,4, 6) > > I would like to plot the following graph: >> plot(x,y) >> ord <- c(7,12,2,3,5,8,9,11,13,4,10,6,1) >> polygon(x[ord],y[ord]) > > How I can obtain the above ordering (in the example an anti-clockwise > ordering) such that I can use polygon() to connect the points? > > I searched previous messages but I did not find any relevant to this > problem. I don't think your problem is well specified! It looks as though you want to draw a polygon, such that the edges linking successive vertices do not intersect (and. as it happens, "anticlockwise"). However, your vertices above do not give a unique solution if the problem is stated in this way. For instance (just looking at the plot) there are the following (and others): 1 7 12 2 3 5 8 9 11 13 4 10 6 1 (the most "natural" order, perhaps) 1 7 12 8 2 3 5 9 11 4 13 10 6 1 1 7 12 2 8 5 3 9 11 13 4 10 6 1 So what more do you need to state, to make the solution unique? Best wishes, Ted. E-Mail: (Ted Harding) <[EMAIL PROTECTED]> Fax-to-email: +44 (0)870 167 1972 Date: 14-Jun-04 Time: 11:31:55 -- XFMail -- __ [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] ordering points as vertex of a polygon
On Mon, 14 Jun 2004, Luca Scrucca wrote: > Dear R-users, > > Suppose I have the following x-y coordinates which give the boundaries of > a polygon: > > x <- c(5,4,5,9,6,6,4,7,10,7,10,4,10) > > y <- c(6,3,2,6,3,7,5,4,4,7, 5,4, 6) > > I would like to plot the following graph: > > plot(x,y) > > ord <- c(7,12,2,3,5,8,9,11,13,4,10,6,1) > > polygon(x[ord],y[ord]) > > How I can obtain the above ordering (in the example an anti-clockwise > ordering) such that I can use polygon() to connect the points? What exactly is the ordering? The polygon is not convex, so the ordering depends on where you measure angles from. Generally though you could try something like. xy <- cbind(x,y) angM <- xy - rep(c(7,5), each=length(x)) angs <- apply(angM, 1, function(x) atan2(x[2], x[1])) ord <- sort.list(angs) which seems to replicate your solution. > I searched previous messages but I did not find any relevant to this > problem. It is not really an R question. -- 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] complete newbie Q
thanks for your extensive info, Petr ! I guess you are right that i should not try to put to much time in R when a simple C application is faster. but there are 2 reasons why I would still try it : - i'm not a statistics or data-analysis expert. I do not know sufficient math to work our fitting algorithms in C. So i would still spend a lot of time researching the underlying math. I hope that R will solve this for me - I don't want my collegues (who are not programmers) to start asking me every little thing. I hope that, by showing them this analysis in R, they will learn some of it themselves and leave me alone :-) I will look into your sample as soon as i find the time ! thanks again ! jeroen __ [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] complete newbie Q
On 06/14/04 09:25, jeroen clarysse wrote: >Hi all > >I'm a programmer at the psychology dept, and last week, I was asked to write >an application to analyze some result data from CO2 measurement experiments. >I don't want to reinvent the wheel, so before I start custom coding in C, >I'd though to look around a bit and bumped into R on freshmeat. > >basically, it is a 2-column data sheet, with timings on col1 and CO2 value >on col2. These value have a pretty nice oscillating nature, with some >occasional false spikes. > >the analysis simply means extracting the 'ceilings' of the curves = the >start-end times of the top of each oscilation. > >my Q to the mailinglist is now : can such analysis be done in R ? Or is R >not the appropriate package for this kind of stuff ? R is certainly the appropriate package - especially for someone with programming experience - but this is not a simple problem no matter what you use. The problem is to eliminate the noise, the "false spikes." I cannot give you the solution, and I notice that nobody else has replied either. But I can tell you that I dealt with a very similar problem (helping the Mozilla Foundation measure the speed of page loading, which turned out to have a periodicity) using various time-series functions, such as acf, as well as trimmed means to get rid of outliers. But the situation was a bit different, as there were several observations at each time point, so I could apply the trimmed mean to that time point. Unfortunately, I don't have time to get more involved in your problem, but this may get you started. I think what you might have to do is iterate between fitting the model and eliminating outliers from the residuals, but maybe some statistician on this list will have a better idea. Jon -- Jonathan Baron, Professor of Psychology, University of Pennsylvania Home page:http://www.sas.upenn.edu/~baron __ [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] complete newbie Q
__ [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] ordering points as vertex of a polygon
Dear R-users, Suppose I have the following x-y coordinates which give the boundaries of a polygon: > x <- c(5,4,5,9,6,6,4,7,10,7,10,4,10) > y <- c(6,3,2,6,3,7,5,4,4,7, 5,4, 6) I would like to plot the following graph: > plot(x,y) > ord <- c(7,12,2,3,5,8,9,11,13,4,10,6,1) > polygon(x[ord],y[ord]) How I can obtain the above ordering (in the example an anti-clockwise ordering) such that I can use polygon() to connect the points? I searched previous messages but I did not find any relevant to this problem. Thanks, Luca +---+ | Dr. Luca Scrucca | | Dipartimento di Scienze Statistiche tel. +39 - 075 - 5855278 | | Università degli Studi di Perugiafax. +39 - 075 - 5855950 | | Via Pascoli - C.P. 1315 Succ. 1 | | 06100 PERUGIA (ITALY)| | (o_ (o_ (o_ | | E-mail: [EMAIL PROTECTED]//\ //\ //\ | | Web page: http://www.stat.unipg.it/luca V_/_ V_/_ V_/_ | +---+ __ [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] Confidence intervals for predicted values in nls
Dear Joerg, Thank you for your mail. It was very helpful. Regards, Cristina __ [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