Re: [R] Equivalent of Excel pivot tables in R

2008-04-26 Thread Simon Blomberg
See also the reshape package. Cheers, Simon. Simon Blomberg, BSc (Hons), PhD, MAppStat. Lecturer and Consultant Statistician Faculty of Biological and Chemical Sciences The University of Queensland St. Lucia Queensland 4072 Australia T: +61 7 3365 2506 email: S.Blomberg1_at_uq.edu.au

[R] Another Question Regarding the nnet package

2008-04-26 Thread Colin Blake Rickert
I have one other question regarding the nnet package in R: What is the value of the step size (often referred to as eta) for the gradient descent function? I dont see anywhere in the API where this value can be modified. Thanks, -Colin __

Re: [R] matrix from list

2008-04-26 Thread Martin Maechler
OL == Olivier Lefevre [EMAIL PROTECTED] on Sat, 26 Apr 2008 01:31:16 +0200 writes: OL Greg Snow wrote: The '[[' only returns a single element from a data structure OL I know but that is precisely what I find arbitrary. OL Anyway you are right that it would still return

[R] quasi-random sequences

2008-04-26 Thread baptiste Auguié
Dear list useRs, I have to generate a random set of coordinates (x,y) in [-1 ; 1]^2 for say, N points. At each of these points is drawn a circle (later on, an ellipse) of random size, as in: N - 100 positions - matrix(rnorm(2 * N, mean = 0 , sd= 0.5), nrow=N) sizes-rnorm(N, mean = 0 ,

Re: [R] quasi-random sequences

2008-04-26 Thread Duncan Murdoch
baptiste Auguié wrote: Dear list useRs, I have to generate a random set of coordinates (x,y) in [-1 ; 1]^2 for say, N points. At each of these points is drawn a circle (later on, an ellipse) of random size, as in: The quasi-random sequences are useful for integration, but they're not

Re: [R] quasi-random sequences

2008-04-26 Thread Prof Brian Ripley
On Sat, 26 Apr 2008, baptiste Auguié wrote: Dear list useRs, I have to generate a random set of coordinates (x,y) in [-1 ; 1]^2 for say, N points. At each of these points is drawn a circle (later on, an ellipse) of random size, as in: N - 100 positions - matrix(rnorm(2 * N, mean = 0 , sd=

Re: [R] Ubuntu vs Mac OS X

2008-04-26 Thread Prof Brian Ripley
Three comments, all from the 'R Installation and Adminstration' manual. 1) In general there is a small performance penalty for using a 64-bit version of R (larger pointers to move around). 2) For speed, bulld yourself a non-shared-library version of R. Those binary maintainers are supplying

Re: [R] How to overlap two density plots?

2008-04-26 Thread Jared O'Connell
Very näively, you could do something like this, plot(density(A)) lines(density(B),col=2) , and tinker your xlim and ylim as suitable. The Cairo library gives a pretty example, data(iris) attach(iris) plot(Petal.Length, rep(-0.03,length(Species)), xlim=c(1,7), ylim=c(0,1.7),

Re: [R] How to overlap two density plots?

2008-04-26 Thread Jared O'Connell
My apologies, the previous replies did not show up for me. On Sat, Apr 26, 2008 at 1:49 PM, Jared O'Connell [EMAIL PROTECTED] wrote: Very näively, you could do something like this, plot(density(A)) lines(density(B),col=2) , and tinker your xlim and ylim as suitable. The Cairo library

Re: [R] 3 questions: debug R script, multi-level sorts, and multi-gsub

2008-04-26 Thread David Winsemius
Ng Stanley [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: 2) I have looked deeply into R, but can't fine multi-level sorts. At the top of the help page for sort... Sort (or order) a vector or factor (partially) into ascending (or descending) order. For ordering along more than one

[R] Help with simulation of heteroskedasticity

2008-04-26 Thread Leo Correia
Hello guys! Sorry to bother with such a question I was trying to generate a monte carlo simulation with heteroskedasticity errors. but I am not sure if the command line that I had wrote is quite correct. the type of heteroskedasticity that I want to create is such as var(e) = var(x^4) I began my

[R] sys.time question - how to improve R performance

2008-04-26 Thread Jiří Voller
Dear R-users, I run my program a difference between sys.times is as follows: user system elapsed 60167.53 2848.75 63278.93 I am quite puzzled how it may happen that system time is so much shorter than user time, I have 2 core computer most of the time (90%) I was not doing anything else

Re: [R] g(x,y) = f(x,y) - e(x)- e(y)?

2008-04-26 Thread William Simpson
Thanks everyone for the help. Greg, I posted the equation from Prof Brillinger's paper. To me it is not clear how or why to subtract a vector from a matrix (since they have diff dimensions). That's why I posted my question to the experts here! Anyway, I have some answers now. Cheers Bill On

Re: [R] sys.time question - how to improve R performance

2008-04-26 Thread Prof Brian Ripley
On Sat, 26 Apr 2008, Jiří Voller wrote: Dear R-users, I run my program a difference between sys.times is as follows: user system elapsed 60167.53 2848.75 63278.93 I am quite puzzled how it may happen that system time is so much shorter than user time, I have 2 core computer most of the

[R] How to use the optim function if the length of the objective function is greater than 1?

2008-04-26 Thread kakul modani
Hi, Please help me out with this.Im a new user of R. Thanks [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Ubuntu vs Mac OS X

2008-04-26 Thread Dirk Eddelbuettel
On 26 April 2008 at 12:27, Prof Brian Ripley wrote: | 3) If you are doing matrix algebra you want an optimized BLAS. The CRAN | build of R for Mac OS by default uses vecLib (which is optimized by | Apple). On other OSes R can be built to use optimized BLAS (see the | manual) -- my

Re: [R] quasi-random sequences

2008-04-26 Thread Robert A LaBudde
You seem to have ambiguous requirements. First, you want equidistribution for a packing structure, which would suggest closest packing or quasirandom sequences, as you have tried. But then you are disturbed by the packing structure, because it gives a perceivable pattern, so you wish to

Re: [R] How to use the optim function if the length of the objectivefunction is greater than 1?

2008-04-26 Thread Charles Annis, P.E.
Help you out with what? You have not provided a commented, minimal, self-contained, reproducible example as you were asked to provide in the bottom text of every note to r-help. Can you expect help with a problem only you know? I *suspect* that you will need to define an objective function,

Re: [R] quasi-random sequences

2008-04-26 Thread Hans W. Borchers
baptiste Auguié ba208 at exeter.ac.uk writes: Dear list useRs, You might be interested to apply the Hammersley or Halton point sets that are often used in numerical integration or Differential Evolution. These pseudo-random distributions are both uniform and irregular, but have a kind of

Re: [R] matrix from list

2008-04-26 Thread Olivier Lefevre
Olivier Lefevre wrote: Anyway you are right that it would still return the kind of object, only subsetted, which is not I want. I mean [] would do that; I know [[]] doesn't. Yet I still don't see why one accepts vector arguments but not the other: they are both indexing operators. It is such

[R] Consistency of m-shapiro.test

2008-04-26 Thread Manuel Rivas
Hello all, I tried several experiments with the mshapiro.test package in R and compared it with the energy package to test for multivariate normality and find that the mshapiro.test is not consistent which is a bit concerning and has suspicious behavior. On the other hand the energy test

Re: [R] matrix from list

2008-04-26 Thread Olivier Lefevre
Martin Maechler wrote: The difference to as.matrix() is that data.matrix() also produces a numeric matrix in the case the data frame contains factors. Thanks, that is useful but it is becoming a little rococo: so may ways to do this. Also, what if I have a list, not a data frame?

[R] nested anova and multiple comparisons

2008-04-26 Thread Stephen Cole
Hello R List: My problem is with a nested anova. I have read the r-help and it has answered some of my questions but i still need some help on this one. I have also posted for help on this data set before, so i apologize in advance for any repetition. My design is as follows: response: Quadrat

Re: [R] quasi-random sequences

2008-04-26 Thread baptiste Auguié
Thank you all for the great suggestions and comments. As two of you pointed out, the problem was not well defined (who said a well-posed problem is a problem solved?), and also it seems to be a very wide topic. I've had an interesting reading discussing the similarities between half-toning

[R] resolution (dpi) problem

2008-04-26 Thread Chris Walker
I am using R 2.4.1 with Windows XP. I use the plot command in a fairly simple script and I use the right mouse click on the plot and save as a postscript file. I used the resultant file in a paper which was submitted electronically. However, I get the following response from the journal: Your

Re: [R] Ubuntu vs. Windows

2008-04-26 Thread George N. White III
On Tue, 22 Apr 2008, Doran, Harold wrote: Dear List: I am very much a unix neophyte, but recently had a Ubuntu box installed in my office. I commonly use Windows XP with 3 GB RAM on my machine and the Ubuntu machine is exactly the same as my windows box (e.g., processor and RAM) as far as I

Re: [R] Use of survreg.distributions

2008-04-26 Thread COREY SPARKS
It would seem to me that your problem is in your data. For survreg, you have to have positive durations, and if your data have y=-5 as seen in Error in survreg(Surv(y, y = -5, type = left) ~ x + : Invalid survival times for this distribution In addition: Warning messages: 1: In

Re: [R] R question about prediction from a fitted model

2008-04-26 Thread David Winsemius
Lisa [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: Hi Jorge, ... the new question is, is there any prediction for the cox model? I tried predict(Surv(y~x),newdata), it only gave the fitted values. Any clue on this? thanks a lot! I cannot claim great expertise in this area, but my

Re: [R] nested anova and multiple comparisons

2008-04-26 Thread Kingsford Jones
Hi Stephen, On Sat, Apr 26, 2008 at 10:29 AM, Stephen Cole [EMAIL PROTECTED] wrote: ...snip... I have managed to accomplish my first two goals by analyzing the data as a 3 level nested Anova with the following code mod1 - aov(Count~Region/Location/Site, data=data) This allows me to get

Re: [R] resolution (dpi) problem

2008-04-26 Thread Marc Schwartz
See comments inline: Chris Walker wrote: I am using R 2.4.1 with Windows XP. First, you are using a version of R that is a year and a half and 6 releases out of date. Version 2.7.0 was just released this past week. You can download it from your nearest CRAN mirror. I use the plot command

Re: [R] resolution (dpi) problem

2008-04-26 Thread Ted Harding
On 26-Apr-08 19:30:35, Chris Walker wrote: I am using R 2.4.1 with Windows XP. I use the plot command in a fairly simple script and I use the right mouse click on the plot and save as a postscript file. I used the resultant file in a paper which was submitted electronically. However, I get

Re: [R] quasi-random sequences

2008-04-26 Thread Stas Kolenikov
You might want to shuffle coordinates independently to get rid of the diagonals. Otherwise what quasi-random sequence guarantee are upper boundaries on the coverage errors, but not anything nice-looking and irregular. Sobol' sequences, even though they are theoretically superior to some others

[R] Calling a stored model within the predict() function

2008-04-26 Thread Jim_S
Hi all, First of all, I'm a novice R user (less that a week), so perhaps my code isn't very efficient. Using the MBoost package I created a model using the following command and saved it to a file for later use: model - gamboost(fpfm,data=SampleClusterData,baselearner=bbs) # Creating a model

[R] reading information

2008-04-26 Thread Manoel Santos
teste2 theta_chapeu f_estrela k a0 a1 a2 a3 13.21.2 3 2 1 4 5 p-function(k){ + i-1 + for(i in 1:k){ + p2=teste2[3+i]} + return(p2)} p3-p(teste2$k) p3 a2 1 4 p3[1] a2 1 4 how i can make an array with the polinomyal function? lilke p3[1]=1 p3[2]=4

[R] Lists of data.frame

2008-04-26 Thread Worik R
I cannot find out how to build data structures as lists of data structures. I want to do... r-help@r-project.org d1 - data.frame(x=1, y=2) d2 - data.frame(x=1, y=3) d3 - data.frame(x=21, y=3) q1 - data.frame(q=d1, n=a) q2 - data.frame(q=d2, n=a) q3 - data.frame(q=d3, n=a) v - vector() or

Re: [R] reading information

2008-04-26 Thread Manoel Santos
p-function(x){ + for(i in 1:teste2[k]+1){ + p2=c+teste2[3+i]*x^(i-1) + c=p2} + return(c)} p3-p(x) if i make this i can use a p(x) calling a function in anohter function? no , right? [[alternative HTML version deleted]] __

[R] system.time()

2008-04-26 Thread Fernando Saldanha
I thought system.time() would return three numbers, the first two adding up to the third one. However, this does not hold in my system running Windows Vista Home Premium, with an Intel Core 2 Duo processor. For example, using the code in the help for system.time() (with one zero added), I got:

Re: [R] Lists of data.frame

2008-04-26 Thread jim holtman
I think this is what you want. You need to look at the help file for ?'[' and ?'[['. Also understand the differences between a data.frame and a list. in the case of defining qn you need to use a list and not a data.frame because here is what happens with a data.frame: q1 - data.frame(q=d1,

[R] integration error when I use optim and integrate simultaneously

2008-04-26 Thread kathie
Dear R users, When I use two functions, 'optim' and 'integrate', simultaneously, I always get an error like this -- numint = function(z) { dlnorm(z,mu[1],sqrt(exp(g[1]))) *

Re: [R] system.time()

2008-04-26 Thread jim holtman
The first two numbers will not add up to the third. The third is the elapsed time (wall clock) and the first two are CPU time; even though they have what appears to be the same units (seconds), they can not really be compared. If, for example, was script was taking input from the console, you

Re: [R] matrix from list

2008-04-26 Thread Greg Snow
So you want mylist[[1:2]] to return something (other than an error) when mylist is a list. What if mylist - list( 1:10, 101:110 , some.other.things) so the first 2 elements are vectors of length 10. then mylist[1:2] makes sense as still being a list with the 2 vectors. What should

Re: [R] integration error when I use optim and integrate simultaneously

2008-04-26 Thread Charles C. Berry
On Sat, 26 Apr 2008, kathie wrote: Dear R users, When I use two functions, 'optim' and 'integrate', simultaneously, I always get an error like this -- numint = function(z) { dlnorm(z,mu[1],sqrt(exp(g[1]))) *