[R] Finding the first value without warning in a loop

2008-12-06 Thread Andreas Wittmann
Dear R useRs, with the following piece of code i try to find the first value which can be calculated without warnings `test` <- function(a) { repeat { ## hide warnings suppressWarnings(log(a)) if (exists("last.warning", envir = .GlobalEnv)) { a <- a + 0.1 ## clear exis

Re: [R] logical inconsistency

2008-12-06 Thread John C Nash
This actually goes back a very long way. Peter is right to remind us that "optimizers" (in the sense of compilers) can corrupt algorithms that are well-designed. Optimizing in tests is something some of us have fought for nearly 40 years, but compiler writers don't do much floating-point compu

[R] Identifying a subset of observations on a 3d-scatter plot using cloud()

2008-12-06 Thread Giam Xingli
Hello everyone, This is my first post to the mailing list, so I hope I am posting my message the correct way. I am trying to present my dataset in a 3d scatterplot using cloud() in the {lattice} package. I hope to explicitly identify a subset of my observations. The observations in this subs

Re: [R] Seasonality in time series

2008-12-06 Thread Girish A.R.
Not sure with decompose(), but the output object of the 'stl' function has a 'time.series' attribute - you need to add the trend and the irregular components to get the seasonally adjusted series. Hope this helps. best, -Girish On Dec 6, 1:45 pm, RON70 <[EMAIL PROTECTED]> wrote: > using decompos

[R] Announcing: Predictive Analytics World, Feb 18-19 in San Francisco

2008-12-06 Thread EliseJ
Hi Everyone, I'm writing to announce a new conference: Predictive Analytics World, Feb 18-19, 2009 in San Francisco (www.predictiveanalyticsworld.com). The goal of Predictive Analytics World is to serve as the go-to event, covering today's commercial deployment of predictive analytics, across in

Re: [R] Running R Script on a Sequence of Files

2008-12-06 Thread Gustavo Carvalho
Thanks a lot! On Fri, Dec 5, 2008 at 5:54 PM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > Try this: > > dir()[!file.info(dir())$isdir] > > > On Fri, Dec 5, 2008 at 2:30 PM, Gustavo Carvalho > <[EMAIL PROTECTED]> wrote: >> Is there a way to list only the files in a given directory without >> pa

Re: [R] unexpected scoping behavior with functions created in a loop

2008-12-06 Thread Antonio, Fabio Di Narzo
2008/12/6 Gabor Grothendieck <[EMAIL PROTECTED]>: > The missing item is lazy evaluation. Try forcing the evaluation of i > and then repeat: > > makeF <- function(i) { force(i); function() i } Tnx! That works! Sometimes lazy evaluation + side effects is just too much (complicated) for me:D bests,

Re: [R] unexpected scoping behavior with functions created in a loop

2008-12-06 Thread Gabor Grothendieck
The missing item is lazy evaluation. Try forcing the evaluation of i and then repeat: makeF <- function(i) { force(i); function() i } On Sat, Dec 6, 2008 at 9:22 PM, Antonio, Fabio Di Narzo <[EMAIL PROTECTED]> wrote: > Hi guys. > I recently stumbled on an unexpected behavior of R when using > f

[R] unexpected scoping behavior with functions created in a loop

2008-12-06 Thread Antonio, Fabio Di Narzo
Hi guys. I recently stumbled on an unexpected behavior of R when using functions created in a loop. The problem is silly enough to me that I had hard time choosing a good mail subject, not talking about searching in the archives... After some experiments, I trimmed down the following minimal reprod

Re: [R] logical inconsistency

2008-12-06 Thread Peter Dalgaard
[EMAIL PROTECTED] wrote: This comment is orthogonal to most of the others. It seems that folk often want to test for equality of "real" numbers. One important one is for convergence tests. When writing my Compact Numerical Methods book I had to avoid lots of logical tests, but wanted to compare t

Re: [R] logical inconsistency

2008-12-06 Thread nashjc
This comment is orthogonal to most of the others. It seems that folk often want to test for equality of "real" numbers. One important one is for convergence tests. When writing my Compact Numerical Methods book I had to avoid lots of logical tests, but wanted to compare two REALs. I found that the

Re: [R] Logical inconsistency

2008-12-06 Thread Stavros Macrakis
On Sat, Dec 6, 2008 at 4:32 PM, Wacek Kusnierczyk < [EMAIL PROTECTED]> wrote: > Stavros Macrakis wrote: > > On Sat, Dec 6, 2008 at 5:02 AM, Wacek Kusnierczyk < > > [EMAIL PROTECTED]> wrote: > >> yepp, though (2/3)*3 not evaluating to 2 is again not a must, is it. > > Why is that less a must than .

Re: [R] How to get Greenhouse-Geisser epsilons from anova?

2008-12-06 Thread Peter Dalgaard
Nils Skotara wrote: Thank you, this helped me a lot! All within effects and interactions work well! Sorry, but I still could not get how to include the between factor.. If I include D with 2 levels, then myma is 24 by 28. (another 12 by 28 for the second group of subjects.) mlmfitD <- lm(myma~D)

Re: [R] assigning a new variable to multiple data frames

2008-12-06 Thread Gabor Grothendieck
Viewing ?assign we see that the first two arguments to assign are required but in the example shown in the question there is only one argument. Also ?assign says the first argument is "a variable name, given as a character string" which is not the case in the code in the question. Also as a matte

Re: [R] Logical inconsistency

2008-12-06 Thread Wacek Kusnierczyk
Stavros Macrakis wrote: > On Sat, Dec 6, 2008 at 5:02 AM, Wacek Kusnierczyk < > [EMAIL PROTECTED]> wrote: > > >> yepp, though (2/3)*3 not evaluating to 2 is again not a must, is it. >> > > > Why is that less a must than .3-.2 == .1? On the contrary, the computing > convention (and for that

[R] assigning a new variable to multiple data frames

2008-12-06 Thread Georg Ehret
Dear R community, I am trying to assign a new variable (named "new") to multiple dataframes by a loop and do not succeed... Can you please help? Thank you and best regards, Georg Ehret. > c V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 1 1 11 21 31 41 51 61 71 81 91 2 2 12 22 32 42 52 62 72 82 92 3

Re: [R] plotting several datasets with different scales into same plot

2008-12-06 Thread Gabor Grothendieck
This is a commonly asked question and you can likely find many examples in the r-help archives. twoord in the plotrix package can do it. Also see example section of: ?plot.zoo in the zoo package looking at the example beginning: ## plot with left and right axes On Sat, Dec 6, 2008 at 3:54 PM, Ge

[R] plotting several datasets with different scales into same plot

2008-12-06 Thread Georg Ehret
Dear Miss R, I wish to plot three datasets on completely different scales into one single plot. Until now I use a complicated procedure, converting the data of the second and third set into coordinates of the first plot and then adding an extra axis. Is there a way to do this more simply...? Th

Re: [R] Logical inconsistency

2008-12-06 Thread Stavros Macrakis
On Sat, Dec 6, 2008 at 5:02 AM, Wacek Kusnierczyk < [EMAIL PROTECTED]> wrote: > yepp, though (2/3)*3 not evaluating to 2 is again not a must, is it. Why is that less a must than .3-.2 == .1? On the contrary, the computing convention (and for that matter the usual scientific and engineering conv

Re: [R] Questions on the results from glmmPQL(MASS)

2008-12-06 Thread Ben Bolker
zhijie zhang wrote: > > Dear Rusers, >I have used R,S-PLUS and SAS to analyze the sample data "bacteria" in > MASS package. Their results are listed below. > I have three questions, anybody can give me possible answers? > Q1:From the results, we see that R get 'NAs'for AIC,BIC and logLik, w

Re: [R] How to get Greenhouse-Geisser epsilons from anova?

2008-12-06 Thread Nils Skotara
Thank you, this helped me a lot! All within effects and interactions work well! Sorry, but I still could not get how to include the between factor.. If I include D with 2 levels, then myma is 24 by 28. (another 12 by 28 for the second group of subjects.) mlmfitD <- lm(myma~D) is no problem, but w

[R] R: R: Morlet wavelet not supportd by wavCWTPeaks

2008-12-06 Thread mauede
I have compressed and attached the 1st cycle of signal 3570. I did not realize the difficulties arising from copying the signal data from the email text. I did not understand how you were reading such data into a vector. When I plotted the signal, the way you read it, it looked periodic, whereas

Re: [R] Barplot label

2008-12-06 Thread Jorge Ivan Velez
Dear Ram, See the "las" argument in ?par. # Some data set.seed(123) x=rpois(100,4) # Barplots barplot(table(x),las=1) barplot(table(x),las=2) barplot(table(x),las=3) HTH, Jorge On Sat, Dec 6, 2008 at 8:15 AM, ram basnet <[EMAIL PROTECTED]> wrote: > Dear all, > I am trying to make barplot fr

Re: [R] Barplot label

2008-12-06 Thread David Winsemius
from the par help page: ( nr.prof <- c(prof.pilots=16,lawyers=11,farmers=10,salesmen=9,physicians=9, mechanics=6,policemen=6,managers=6,engineers=5,teachers=4, housewives=3,students=3,armed.forces=1)) barplot(rbind(nr.prof) par(las = 3) barplot(rbind(nr.prof)) par(las = 0)# reset to

[R] Inversing a non-monotonic spline

2008-12-06 Thread Geoff Mercer
I have developed a GAM model in order to predict Y using 4 X variables. 2 of these X's are factors, and 1 is a spline. Part of the data looks like: DaysWRM variety PWM O_EC 31 75 1 90 234 31 79 1 78 283 31 82 1 92 281 3

Re: [R] How to calculate words in column?

2008-12-06 Thread David Winsemius
On Dec 6, 2008, at 11:30 AM, Edwin Sendjaja wrote: Hi, I have a table for an 1 week exam result for many classes in school, like this: Day Class_ID TestResult 1 Monday1 Paper Passed 2 Tuesday1 Oral Passed 3 Friday 1

Re: [R] legend at fixed distance form the bottom

2008-12-06 Thread Gabor Grothendieck
Its independent of the scale of the graph. On Sat, Dec 6, 2008 at 12:07 PM, Christophe Genolini <[EMAIL PROTECTED]> wrote: > Lol. > To me, a "fixed amount" that depends on the size of the graph is not much > fixed... > > --- 8< --- > > symboles <- c(3,4,5,6) > dn <- rbind(matrix(rnorm(20),,5),matr

Re: [R] R: Morlet wavelet not supportd by wavCWTPeaks

2008-12-06 Thread stephen sefick
Now, wavelet analysis works with non-stationary signals the package is an implememtation of wavelet analysis. The signal that I used was the one that you provided. I did copy it out of an email and put it together into a vector so that I could read it in. If the original data is wrong that is pr

Re: [R] legend at fixed distance form the bottom

2008-12-06 Thread Christophe Genolini
Lol. To me, a "fixed amount" that depends on the size of the graph is not much fixed... --- 8< --- symboles <- c(3,4,5,6) dn <- rbind(matrix(rnorm(20),,5),matrix(rnorm(20,2),,5)) listSymboles <- rep(symboles,each=2) layout(matrix(c(1,1,1,2,2,3),3)) for(i in 1:3){ plot(dn) legend("top", pch

[R] Barplot label

2008-12-06 Thread ram basnet
Dear all, I am trying to make barplot from matrix with "beside=FALSE". I have 165 labels in my bar plot. When i plot the label horizontally below the barplot, then all labels are not appear in the plot due to lack of space. I used the following function: barplot(t(bar), main="Barplot based on L

[R] How to calculate words in column?

2008-12-06 Thread Edwin Sendjaja
Hi, I have a table for an 1 week exam result for many classes in school, like this: Day Class_ID TestResult 1 Monday1 Paper Passed 2 Tuesday1 Oral Passed 3 Friday 1 Paper Passed 4 Monday3

Re: [R] legend at fixed distance form the bottom

2008-12-06 Thread Gabor Grothendieck
> I would like to add a legend under a graph but at a fixed distance from the > graphe" The top of the legend is always a fixed amount below the graph (which is what you asked for). __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/list

Re: [R] R vs Python performance-wise

2008-12-06 Thread Martin Maechler
> "JQ" == Jose Quesada <[EMAIL PROTECTED]> > on Sat, 06 Dec 2008 12:28:34 +0100 writes: JQ> Hi, Has anyone run any R vs Python (numpy) tests? I'd JQ> love to see what the differences performance-wise are, JQ> specially handling large sparse matrices. Since both JQ> re

Re: [R] legend at fixed distance form the bottom

2008-12-06 Thread Christophe Genolini
Thanks to answering me Gabor I am not sur I understand : I had your line to my graph. Then I resize my graph but the legend is still moving. In "inset = c(0,1.1)", 1.1 means "110% of the y length of the plot region". So when the plot region change, the distance between the legend and the top ax

[R] Luis Miguel Delgado Gomez/BBK está ausente d e la oficina.

2008-12-06 Thread Luis Miguel Delgado Gomez
Estaré ausente de la oficina desde el 05/12/2008 y no volveré hasta el 22/12/2008. Responderé a su mensaje cuando regrese. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] legend at fixed distance form the bottom

2008-12-06 Thread Gabor Grothendieck
inset= is measured from the margin so the trick is to inset it relative to the top even if you want it at the bottom: legend("top", pch = unique(listSymboles), legend = c("ane", "cheval", "poney", "mule"), inset = c(0,1.1), horiz = TRUE, xpd = NA) On Fri, Dec 5, 2008 at 8:39 AM, Christophe Geno

Re: [R] legend at fixed distance form the bottom

2008-12-06 Thread Christophe Genolini
Thanks for your answer. Unfortunatly, I can not create the graphice with the final size since I am writing a package in wich the user will have to chose between several graphics, and then he will have to export one. And they might be one graph, or 2x2, or 3x3... I check the grconvertY but I

Re: [R] snowfall sfInit error

2008-12-06 Thread Prof Brian Ripley
On Sat, 6 Dec 2008, [EMAIL PROTECTED] wrote: Dear all, I am trying to execute the simple example in snowfall http://cran.r-project.org/web/packages/snowfall/vignettes/snowfall.pdf ... require(snow) require(snowfall) sfInit( parallel=TRUE, cpus=2 ) sfLapply( 1:10, exp ) sfStop() I have install

[R] snowfall sfInit error

2008-12-06 Thread chibco
Dear all, I am trying to execute the simple example in snowfall http://cran.r-project.org/web/packages/snowfall/vignettes/snowfall.pdf ... require(snow) require(snowfall) sfInit( parallel=TRUE, cpus=2 ) sfLapply( 1:10, exp ) sfStop() I have installed the snow and snowfall packages in R on a mach

[R] R: Morlet wavelet not supportd by wavCWTPeaks

2008-12-06 Thread mauede
Sure. Now it works ... but it is a different signal ! I could not understand how the signal I sent was modified. So I plotted yours version of the signal and mine (see attachments). My signal represent a single breathing cycle extracted from a breathing signal. It shows that the individual comple

[R] R vs Python performance-wise

2008-12-06 Thread Jose Quesada
Hi, Has anyone run any R vs Python (numpy) tests? I'd love to see what the differences performance-wise are, specially handling large sparse matrices. Since both rely on external C code, there might not be much of a difference. If you know and use both languages, what are the main differenc

Re: [R] How to calculate the distance between two density functions

2008-12-06 Thread Rainer M Krug
On Fri, Dec 5, 2008 at 3:59 PM, Chang Jia-Ming <[EMAIL PROTECTED]> wrote: > Dear all, > > I wrote the following code to calculate the density functions for two data > sets, respectively. > > den_str <-density(str_data$Similarity); > den_non_str <-density(nonstr_data$Similarity); > > However, I

Re: [R] xtable html links

2008-12-06 Thread Gabor Grothendieck
Try this: print(xtable(mat2), type = "html", file = "test.html", sanitize.text.function = force) On Fri, Dec 5, 2008 at 3:43 PM, Tim Smith <[EMAIL PROTECTED]> wrote: > Hi, > > I was trying to get hyperlinks using xtable, but couldn't get the hyperlinks > to function properly. For example, if I

[R] about qqmath, thanks!

2008-12-06 Thread Weijia You
Dear collegues, Is there anyone who ever used qqmath(). Actually, I want to know the distribution of the dependent varible. It's a count number, so it should be poisson or negative binomial distribution. But how could I use R to get the ë and á? Or to demonstrate the distribution to be negative

Re: [R] xtable html links

2008-12-06 Thread Liviu Andronic
On Fri, Dec 5, 2008 at 9:43 PM, Tim Smith <[EMAIL PROTECTED]> wrote: > I was trying to get hyperlinks using xtable, but couldn't get the hyperlinks > to function properly. For example, if I use > Perhaps hwriter [1] could be of use. Check its home page. Liviu [1] http://cran.at.r-project.org/web/

Re: [R] Logical inconsistency

2008-12-06 Thread Wacek Kusnierczyk
Stavros Macrakis wrote: > On Fri, Dec 5, 2008 at 8:18 AM, Wacek Kusnierczyk < > [EMAIL PROTECTED]> wrote: > > >> well, this answer the question only partially. this explains why a >> system with finite precision arithmetic, such as r, will fail to be >> logically correct in certain cases. it d

Re: [R] Logical inconsistency

2008-12-06 Thread Bernardo Rangel Tura
On Fri, 2008-12-05 at 14:18 +0100, Wacek Kusnierczyk wrote: > Berwin A Turlach wrote: > > Dear Emma, > > > > On Fri, 5 Dec 2008 04:23:53 -0800 (PST) > > emma jane <[EMAIL PROTECTED]> wrote: > > > > > >> Please could someone kindly explain the following inconsistencies > >> I've discovered__whe

Re: [R] Logical inconsistency

2008-12-06 Thread Wacek Kusnierczyk
Berwin A Turlach wrote: > G'day Wacek, > > On Fri, 05 Dec 2008 14:18:51 +0100 > Wacek Kusnierczyk <[EMAIL PROTECTED]> wrote: > > >> well, this answer the question only partially. this explains why a >> system with finite precision arithmetic, such as r, will fail to be >> logically correct in c

Re: [R] Seasonality in time series

2008-12-06 Thread RON70
using decompose() function how can I get only seasonally adjusted series? GR-13 wrote: > > Here's something that may help you get started: > library(ts) > ?decompose > ?stl > > Thanks, > -Girish > > On Dec 5, 1:55 pm, Matthias <[EMAIL PROTECTED]> wrote: >> Hi, >> I?m looking for a package whi

Re: [R] Logical inconsistency

2008-12-06 Thread Stavros Macrakis
On Fri, Dec 5, 2008 at 8:18 AM, Wacek Kusnierczyk < [EMAIL PROTECTED]> wrote: > well, this answer the question only partially. this explains why a > system with finite precision arithmetic, such as r, will fail to be > logically correct in certain cases. it does not explain why r, a > language s

[R] xtable html links

2008-12-06 Thread Tim Smith
Hi, I was trying to get hyperlinks using xtable, but couldn't get the hyperlinks to function properly. For example, if I use ## Try to link NY times website to every figure in column 4 mat <- matrix(1:43,6,5) mat[,5] <- "http://nytimes.com"; for(i in 1:nrow(mat)){ strr <- paste('', mat[i,4

[R] Questions on the results from glmmPQL(MASS)

2008-12-06 Thread zhijie zhang
Dear Rusers, I have used R,S-PLUS and SAS to analyze the sample data "bacteria" in MASS package. Their results are listed below. I have three questions, anybody can give me possible answers? Q1:From the results, we see that R get 'NAs'for AIC,BIC and logLik, while S-PLUS8.0 gave the exact values