Re: [R] rbind with different columns

2010-06-21 Thread Daniel Malter
Works wonderfully. I am very happy that I eventually found this post :) Daniel. -- View this message in context: http://r.789695.n4.nabble.com/rbind-with-different-columns-tp907370p2263588.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] how to efficiently compute set unique?

2010-06-21 Thread Douglas Bates
On Mon, Jun 21, 2010 at 8:38 PM, David Winsemius wrote: > > On Jun 21, 2010, at 9:18 PM, Duncan Murdoch wrote: > >> On 21/06/2010 9:06 PM, G FANG wrote: >>> >>> Hi, >>> >>> I want to get the unique set from a large numeric k by 1 vector, k is >>> in tens of millions >>> >>> when I used the matlab

Re: [R] how to efficiently compute set unique?

2010-06-21 Thread Steve Taylor
The original question was about a matrix, not a vector and this is much slower: x <- sample(10, size=13584763, replace=T) dim(x) <- c(13584763, 1) system.time(unique(x)) So the solution would be: unique(as.vector(x)) >>> From: Duncan Murdoch To:G FANG CC: Date: 22/Jun/2010 1:20p Subjec

Re: [R] how to efficiently compute set unique?

2010-06-21 Thread David Winsemius
On Jun 21, 2010, at 9:18 PM, Duncan Murdoch wrote: On 21/06/2010 9:06 PM, G FANG wrote: Hi, I want to get the unique set from a large numeric k by 1 vector, k is in tens of millions when I used the matlab function unique, it takes less than 10 secs but when I tried to use the unique in R wi

[R] RSQLite and fetching rows from multiple tables

2010-06-21 Thread Jonathan Greenberg
I'm trying to use RSQLite statement to cycle through a large database in "chunks" via the fetch(...,n=2). As far as I can tell, however, it keeps re-fetching the same beginning set of rows -- any ideas what might be wrong with the following code? The select statement is pulling from multiple

Re: [R] how to efficiently compute set unique?

2010-06-21 Thread Duncan Murdoch
On 21/06/2010 9:06 PM, G FANG wrote: Hi, I want to get the unique set from a large numeric k by 1 vector, k is in tens of millions when I used the matlab function unique, it takes less than 10 secs but when I tried to use the unique in R with similar CPU and memory, it is not done in minutes

[R] how to efficiently compute set unique?

2010-06-21 Thread G FANG
Hi, I want to get the unique set from a large numeric k by 1 vector, k is in tens of millions when I used the matlab function unique, it takes less than 10 secs but when I tried to use the unique in R with similar CPU and memory, it is not done in minutes I am wondering, am I using the function

Re: [R] {Spam?} RE: {Spam?} RE: {Spam?} Re: mgcv, testing gamm vs lme, which degrees of freedom?

2010-06-21 Thread Christos Argyropoulos
Hi Carlo, One "quick" way to verify that the fixed effects parts are the same, is to examine the design matrices that "gamm" passes on to lme. They should be the same if the interpretation is correct. If you want to follow the mixed effect relation to its end, why not specify "REML" as the fi

Re: [R] how to initial a list to store data result?

2010-06-21 Thread Bill.Venables
The usual method is either lis <- vector("list") or, nearly equivalently, lis <- list() If you know in advance how many components the list will have, there can be a slight advantage in using lis25 <- vector("list", 25) if e.g. you know the list will be of length 25. Bill Venables. ---

Re: [R] {Spam?} RE: {Spam?} RE: {Spam?} Re: mgcv, testing gamm vs lme, which degrees of freedom?

2010-06-21 Thread Carlo Fezzi
Hi Christos, thanks for your kind reply, I agree entirely with your interpreation. In the first model comparison, however, "anova" does seem to work according to our interpretation, i.e. the "df" are equal in the two model. My intuition is that the "anova" command does a fixed-effect test rather

Re: [R] how to initial a list to store data result?

2010-06-21 Thread William Dunlap
Use result <- vector("list", n) to make a list of length n, all of whose components are NULL. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Peter Langfelder > Sent:

Re: [R] how to initial a list to store data result?

2010-06-21 Thread David Winsemius
On Jun 21, 2010, at 7:18 PM, song song wrote: May I ask how to initialize a list? usually I will use " result=list(0) " to do this. is this right? There is now something in that list, namely an element whose value is zero. If you append to it with the c() function, the 0 will still be t

Re: [R] how to initial a list to store data result?

2010-06-21 Thread Peter Langfelder
On Mon, Jun 21, 2010 at 4:18 PM, song song wrote: > May I ask how to initialize a list? > > usually I will use " result=list(0) "  to do this. is this right? It works, but it is cleaner to use results=list() The difference is that list(0) will have one component that contains the number zero, w

Re: [R] survfit function - event information???

2010-06-21 Thread David Winsemius
On Jun 21, 2010, at 6:50 PM, CC wrote: Hi all! I am trying to extract output information from the survfit function in order to generate a matrix of select output for multiple factors. Specifically, I am interested in extracting the number of events (in the output below: 106, 2, 3). The v

[R] how to initial a list to store data result?

2010-06-21 Thread song song
May I ask how to initialize a list? usually I will use " result=list(0) " to do this. is this right? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the post

[R] glm

2010-06-21 Thread Samuel Okoye
Hi, I have the following data data1 <- data.frame(count = c(0,1,1,2,4,5,13,16,14), weeks = 1:9,     treat=c(rep("1mg",3),rep("5mg",3),rep("10mg",3))) and I am using library(splines) to fit glm.m <- glm(count~bs(weeks)+as.factor(treat),family=poisson,data=data1) and I am inte

Re: [R] {Spam?} RE: {Spam?} Re: mgcv, testing gamm vs lme, which degrees of freedom?

2010-06-21 Thread Christos Argyropoulos
Hi, >From my understanding, GAMs as well as GAMMs can be represented as >(generalized) mixed models (Simon discusses this in the last chapter of his >book; a condensed overview from a Bayesian perspective is given in the >following paper by Y. Zhao, J. Staudenmayer, B. A. Coull and M. P. Wand

[R] survfit function - event information???

2010-06-21 Thread CC
Hi all! I am trying to extract output information from the survfit function in order to generate a matrix of select output for multiple factors. Specifically, I am interested in extracting the number of events (in the output below: 106, 2, 3). The variable names represented in my function (ee) ar

Re: [R] {Spam?} RE: {Spam?} Re: mgcv, testing gamm vs lme, which degrees of freedom?

2010-06-21 Thread Carlo Fezzi
Thanks for your help, Bert, on your points: 1. I was not aware of such a list, I will check it out. 2. As you said Pinheiro and Bates (2000) advocate anova LR test for random effect with the SAME fixed effect. My question was exactly related to this point... are the fixed effect the same in this

Re: [R] Re : Design of experiments for Choice-Based Conjoint Analysis (CBC)

2010-06-21 Thread John Williams
On 21/06/10 20:32, Aline Deschamps wrote: Thank you for your mail and the attached documents. You're most welcome :-) I've read the article and I found it very interesting, but I have some questions : - The 5 steps in this article are for creating a choice set for one respondent, are they? Y

[R] Interactive R Learning Website

2010-06-21 Thread Lanna Jin
Hey all, Here's a website I've been working on for the NPS to help move them toward using R (took some of T. Philippi's stuff and spruced it up a bit; also added some of my own material). I've tried to integrate interactivity in the website to help make learning R less painful (tooltip for parsi

Re: [R] tables

2010-06-21 Thread John Kane
?prop.table probably. RSiteSearch at R Site Search http://finzi.psych.upenn.edu/nmz.html or ?RSiteSearch would probably given you the anwser in about 30 seconds. --- On Mon, 6/21/10, Erin Hodgess wrote: > From: Erin Hodgess > Subject: [R] tables > To: "R help" > Received: Monday, June 21,

Re: [R] tables

2010-06-21 Thread David Winsemius
On Jun 21, 2010, at 2:46 PM, Erin Hodgess wrote: Dear R People: I have generated the following table: table(zza$DEATH,zza$GENDER) F M 2009-04-21 0 1 2009-04-22 4 2 2009-04-24 6 0 2009-04-25 1 3 2009-04-26 2 0 2009-04-28 3 0 2009-04-29 2 2

Re: [R] All possible permutations of a 3 group assignment vector

2010-06-21 Thread Charles C. Berry
On Mon, 21 Jun 2010, Duplisea, Daniel wrote: Hello. Given this group assignment vector x: x= rep(letters[1:3],c(9,21,9)) I would like to know the number of all possible unique permutations of x and also obtain the matrix of them. Do you mean what would ncol( unique( replicate( Inf,

Re: [R] Time in ggplot2

2010-06-21 Thread Ottar Kvindesland
Thanks Hadley for taking the interest here. The data sets are a bit large and I have placed them available for your download on http://master.kvindesland.no/R/ You will find datasets in both Rdata and dput format. It seems that some data sets works nicely and others do not even if they come from

Re: [R] {Spam?} Re: mgcv, testing gamm vs lme, which degrees of freedom?

2010-06-21 Thread Bert Gunter
Bert Gunter Genentech Nonclinical Statistics > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Joris Meys > Sent: Monday, June 21, 2010 12:09 PM > To: Carlo Fezzi > Cc: r-help@r-project.org > Subject: Re: [R] {Spam?} Re: mgcv,

Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-21 Thread Muenchen, Robert A (Bob)
>-Original Message- >From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] >On Behalf Of Joris Meys >Sent: Monday, June 21, 2010 5:32 AM >To: Patrick Burns >Cc: r-help@r-project.org >Subject: Re: [R] Popularity of R, SAS, SPSS, Stata... > >On Mon, Jun 21, 2010 at 11:15

Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-21 Thread Muenchen, Robert A (Bob)
>-Original Message- >From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] >On Behalf Of Patrick Burns >Sent: Monday, June 21, 2010 5:16 AM >To: r-help@r-project.org >Subject: Re: [R] Popularity of R, SAS, SPSS, Stata... > >I think there is a problem with the >question:

Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-21 Thread Muenchen, Robert A (Bob)
>-Original Message- >From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] >On Behalf Of Ted Harding >Sent: Sunday, June 20, 2010 9:01 PM >To: r-help@r-project.org >Subject: Re: [R] Popularity of R, SAS, SPSS, Stata... ... > >John and I discussed the snowball idea at so

Re: [R] tables

2010-06-21 Thread Phil Spector
Erin - Here's a reproducible example that should help answer your question: set.seed(17) df = data.frame(a=sample(letters[1:5],250,replace=TRUE), + b=sample(c('A','B'),250,replace=TRUE)) tt = table(df$a,df$b) 100 * prop.table(tt) # total of all percentages = 100

Re: [R] How to predict the mean and variance of the dependent variable after regression

2010-06-21 Thread Joshua Wiley
On Mon, Jun 21, 2010 at 11:45 AM, Yi wrote: > Hi, Josh, > > Thank you very much! It is what I want! > Because it is very obvious that the variance is not a constant in my linear > model. So I am thinking about robust standand error. Any code works for this > purpose in R? I do not have much exper

Re: [R] {Spam?} Re: mgcv, testing gamm vs lme, which degrees of freedom?

2010-06-21 Thread Joris Meys
Hi Carlo, You should get the book of Simon Wood and read it thoroughly. It's all explained in there, but it will lead me too far to copy it all in a mail. In short : random effects are part of the error structure of the model, not of the model itself. They're added to correct the error on the para

Re: [R] Spatial: number of independent components?

2010-06-21 Thread Daniel Malter
I was missing the spam library. I did some testing with m x m matrices (see below). Computing 'a' is the villain. The computation time for 'a' is exponential in m. For a 100 by 100 matrix, the predicted time is about 20 seconds. Thus, 100,000 runs, would take about 23 days. library(igraph) libr

Re: [R] Contrast interaction effects in lmer object for reciprocal transplant experiment

2010-06-21 Thread Steven Brady
Dear All: My apologies, but my formatting of the original message was poor. Here it is again with more appropriate spacing for copying into the terminal. I am using lmer() {lme4} to analyze results from a reciprocal transplant experiment where the response variable is modeled as a fu

[R] tables

2010-06-21 Thread Erin Hodgess
Dear R People: I have generated the following table: > table(zza$DEATH,zza$GENDER) F M 2009-04-21 0 1 2009-04-22 4 2 2009-04-24 6 0 2009-04-25 1 3 2009-04-26 2 0 2009-04-28 3 0 2009-04-29 2 2 However, instead of total counts in the F an

[R] ess - History Expansion

2010-06-21 Thread Vinu Jacob
Hello R world, Can't seem to get history expansion working in R under emacs 23.2 with ess on mac osx. (Vincent Goulet's package). Even '!!' does not get me the previous command. What could be wrong? Thanks, vj __ R-help@r-project.org mailing lis

Re: [R] How to predict the mean and variance of the dependent variable after regression

2010-06-21 Thread Joshua Wiley
Hello, If you just want the mean and variance of log(y) try: mean(log(y)) var(log(y)) if there is missing data, you can add na.rm=TRUE to both of those. If you want the mean and variance of the predicted ys mean(predict(linmod)) var(predict(linmod)) see ?mean ?var ?predict.lm #the specific m

[R] How to predict the mean and variance of the dependent variable after regression

2010-06-21 Thread Yi
Hi, folks, As seen in the following codes: x1=rlnorm(10) x2=rlnorm(10,mean=2) y=rlnorm(10,mean=10)### Fake dataset linmod=lm(log(y)~log(x1)+log(x2)) After the regression, I would like to know the mean of y. Since log(y) is normal and y is lognormal, I need to know the mean and variance of log(y)

[R] Contrast interaction effects in lmer object for reciprocal transplant experiment

2010-06-21 Thread Steven Brady
Dear All: I am using lmer() {lme4} to analyze results from a reciprocal transplant experiment where the response variable is modeled as a function of two fixed effects and their interaction. Example data follow: #library(lme4) #library(gmodels) env=c("r","r","w","w","r","r","w","w","r","r

Re: [R] Same function name

2010-06-21 Thread Filoche
Thank you all for your quick answers. Best, Phil -- View this message in context: http://r.789695.n4.nabble.com/Same-function-name-tp2262633p2262955.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list ht

Re: [R] {Spam?} Re: mgcv, testing gamm vs lme, which degrees of freedom?

2010-06-21 Thread Carlo Fezzi
Hi Joris (CC Simon), Thanks for your kind replies and for being so responsive. I think this post boils down to two main questions (which I feel are very important for gams modelling): 1- Is it appropriate to use LR tests in "gamm" to test model reduction? 2- If yes, which degrees of freedom shou

[R] odfWeave accented chars in a plot iconv

2010-06-21 Thread Laurent Rhelp
Dear R-List, I try to use accented chars in a plot using odfWeave (see the example below). I found the solution using the iconv command to write the accented char "é". But, is somebody know another solution not to have to use iconv command every time ? Thanks Example : <>= par(mfrow=c(1,

[R] All possible permutations of a 3 group assignment vector

2010-06-21 Thread Duplisea, Daniel
Hello. Given this group assignment vector x: x= rep(letters[1:3],c(9,21,9)) I would like to know the number of all possible unique permutations of x and also obtain the matrix of them. Thus, each vector should still contain 9*a, 21*b and 9*c, but case assigment must be different for one case (d

Re: [R] Same function name

2010-06-21 Thread Charles C. Berry
On Mon, 21 Jun 2010, Filoche wrote: Hi everyone. I want to use 2 different functions (in 2 packages) that have same name. for instance, if I call the function, it will use the one in the last called package. Is there a way to specify the package to use for a function? Something like Package

Re: [R] S3 generics need identical signature?

2010-06-21 Thread Thomas Lumley
On Mon, 21 Jun 2010, Henrik Bengtsson wrote: On Mon, Jun 21, 2010 at 4:23 PM, Gábor Csárdi wrote: On Mon, Jun 21, 2010 at 4:17 PM, Duncan Murdoch wrote: [...] The requirement is that the methods need to have signatures that contain all the arguments of the generic.  If the generic includes .

Re: [R] list() assigning the same value to two items

2010-06-21 Thread Gabor Grothendieck
On Mon, Jun 21, 2010 at 6:58 AM, Thaler, Thorn, LAUSANNE, Applied Mathematics wrote: > Thanks, works as expected. But maybe I've to be a bit more clear about the > reason why I'd like to have such a construct. > > In lattice you can define some parameters by passing a named list to > par.setting

Re: [R] using table and tapply?

2010-06-21 Thread Charles C. Berry
On Sun, 20 Jun 2010, Erin Hodgess wrote: Dear R People: Here is a little section of a data frame: zzz[1:10,] DATE GENDER AGE Co DEATH1 3945 2009-04-16 M 24Botulinic 23 3851 2009-04-16 M 35 Constitutional 23 8495 2009-04-16 F 49

Re: [R] Interpreting lm Residuals...

2010-06-21 Thread David Winsemius
On Jun 21, 2010, at 10:27 AM, David Riebel wrote: I am using the lm function in R to fit several linear models to a fair-sized dataset (~160 collections of ~1000 data points each). My data have intrinsic, systematic uncertainty much greater than the measurement errors on any individual point.

Re: [R] MANOVA proportion of variance explained

2010-06-21 Thread Michael Friendly
Sam Brown wrote: Hi Michael Thank you very much for the intel regarding eta^2. It is pretty much the sort of thing that I am wanting. The latest developer version of the heplots package on R-Forge now includes an initial implementation of etasq() for multivariate linear models. Note that f

Re: [R] Same function name

2010-06-21 Thread Barry Rowlingson
On Mon, Jun 21, 2010 at 2:29 PM, Filoche wrote: > > Hi everyone. > > I want to use 2 different functions (in 2 packages) that have same name. for > instance, if I call the function, it will use the one in the last called > package.  Is there a way to specify the package to use for a function? > >

Re: [R] S3 generics need identical signature?

2010-06-21 Thread Henrik Bengtsson
On Mon, Jun 21, 2010 at 4:23 PM, Gábor Csárdi wrote: > On Mon, Jun 21, 2010 at 4:17 PM, Duncan Murdoch > wrote: > [...] >> The requirement is that the methods need to have signatures that contain all >> the arguments of the generic.  If the generic includes ..., then the methods >> can add other

Re: [R] Calculating a daily average

2010-06-21 Thread David Winsemius
On Jun 21, 2010, at 10:27 AM, ecvet...@uwaterloo.ca wrote: I have a set of data with 12 readings for temperature per day, with 180 days. I want to find the average temperature of each day. I am able to do this one by one, but with that many days to calculate the average for, it will get ve

Re: [R] Garch in the mean

2010-06-21 Thread Liviu Andronic
On Mon, Jun 21, 2010 at 3:48 PM, Aaron Plavnick/MSINVESTORS wrote: > I was wondering if anyone knew how to fit a series using a Garch-M (Garch > in the mean) model. From what I gathered from the documentation, it does > Perhaps rgarch [1]? Also, you might get better help if you were posting to r-s

Re: [R] Same function name

2010-06-21 Thread Peter Langfelder
package::function On Mon, Jun 21, 2010 at 6:29 AM, Filoche wrote: > > Hi everyone. > > I want to use 2 different functions (in 2 packages) that have same name. for > instance, if I call the function, it will use the one in the last called > package.  Is there a way to specify the package to use f

[R] Same function name

2010-06-21 Thread Filoche
Hi everyone. I want to use 2 different functions (in 2 packages) that have same name. for instance, if I call the function, it will use the one in the last called package. Is there a way to specify the package to use for a function? Something like Package1:myfunction(...) Package2:myfunction(x

[R] Calculating a daily average

2010-06-21 Thread ecvetano
I have a set of data with 12 readings for temperature per day, with 180 days. I want to find the average temperature of each day. I am able to do this one by one, but with that many days to calculate the average for, it will get very long. I'm sure there is a faster way to do this, I just d

Re: [R] Play symbol

2010-06-21 Thread Florian Burkart
Hi Jim, that works perfectly. Thanks Florian On 21/06/2010 14:10, Jim Lemon wrote: On 06/21/2010 09:51 PM, Florian Burkart wrote: Hi together, I am looking to plot a play symbol (e.g. a triangle with the tip facing east) with the points command, but I noticed that this symbol is not avai

[R] Garch in the mean

2010-06-21 Thread Aaron Plavnick/MSINVESTORS
Hello, I was wondering if anyone knew how to fit a series using a Garch-M (Garch in the mean) model. From what I gathered from the documentation, it does not seem to be implemented in either fGarch, fSeries, or tSeries. Perhaps there is an option that allows this functionality. Otherwise, if i

Re: [R] ctree

2010-06-21 Thread Steve_Friedman
Joris, Thank you, your solution did what I needed. Steve Friedman Ph. D. Spatial Statistical Analyst Everglades and Dry Tortugas National Park 950 N Krome Ave (3rd Floor) Homestead, Florida 33034 steve_fried...@nps.gov Office (305) 224 - 4282 Fax (305) 224 - 4147

[R] InfiniDB

2010-06-21 Thread Albrecht, Dr. Stefan (AIM SE)
Dear all, does anybody have experience with the open source database InfiniDB http://www.infinidb.org/index.php? The contributor Calpont claims that it would much faster than the standard MySQL for certain applications. How would you install it that InfiniDB can run with the package RMySQL unde

Re: [R] Problem with package installation

2010-06-21 Thread Uwe Ligges
No idea, do you have the right repository seledcted? Is there nay proxy in your network that may change the download data for some reason? I have not observed that before and I haven't seen similar reports before. Best, Uwe Ligges On 21.06.2010 11:03, Rubén Roa wrote: Dear ComRades, I am ha

Re: [R] S3 generics need identical signature?

2010-06-21 Thread Gábor Csárdi
On Mon, Jun 21, 2010 at 4:17 PM, Duncan Murdoch wrote: [...] > The requirement is that the methods need to have signatures that contain all > the arguments of the generic.  If the generic includes ..., then the methods > can add other arguments, too.  So with the generic for plot() as you show > a

Re: [R] S3 generics need identical signature?

2010-06-21 Thread Duncan Murdoch
On 21/06/2010 9:31 AM, Gábor Csárdi wrote: Dear all, "Writing R Extensions" explicitly says that A method must have all the arguments of the generic, including ... if the generic does. A method must have arguments in exactly the same order as the generic. If the generic specifies de

Re: [R] ctree

2010-06-21 Thread Joris Meys
You can't get them out of the plot function, but you can calculate them from the fit. This code returns a matrix with the appropriate rownames and colnames. x1 <- treeresponse(iris.ct) p <- matrix( unlist(unique(x1)), ncol=3, byrow=T ) colnames(p) <- levels(iris$Species) rowname

Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-21 Thread Frank E Harrell Jr
It may be worthwhile tracking citations in "early adopter" journals such as statistical methodology journals, then watching trends in later adopter subject matter journals (in medical research this might be JAMA, NEJM). Frank On 06/21/2010 08:11 AM, Kjetil Halvorsen wrote: One should also t

Re: [R] ctree

2010-06-21 Thread Achim Zeileis
On Mon, 21 Jun 2010, steve_fried...@nps.gov wrote: Hello, This is a re-submittal of question I submitted last week, but haven't rec'd any responses. I need to extract the probabilities used to construct the barplots displayed as part of the graph produced by plot("ctree"). For example, libr

Re: [R] Spatial: number of independent components?

2010-06-21 Thread Nikhil Kaza
I just updated spdep and I see that as.spam.listw works. Below is sessionInfo Furthermore, it may be straightforward to condense the adjacency matrix *before* converting to graph which may help a little bit. You can profile the code and see which part needs speeding up. library(spdep) lib

Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-21 Thread Peter Dalgaard
Patrick Burns wrote: > I think there is a problem with the > question: Not everyone thinks of R > as a statistics program. Furthermore, > I don't think it should be thought of > as a statistics program. > > (Statistics is what stuffy professors > do, I just look at my data and try to > figure ou

Re: [R] Return value associated with a factor

2010-06-21 Thread GL
Works great. Thanks much! -- View this message in context: http://r.789695.n4.nabble.com/Return-value-associated-with-a-factor-tp2262605p2262656.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https:

[R] S3 generics need identical signature?

2010-06-21 Thread Gábor Csárdi
Dear all, "Writing R Extensions" explicitly says that A method must have all the arguments of the generic, including ... if the generic does. A method must have arguments in exactly the same order as the generic. If the generic specifies defaults, all methods should use the same defau

[R] ctree

2010-06-21 Thread Steve_Friedman
Hello, This is a re-submittal of question I submitted last week, but haven't rec'd any responses. I need to extract the probabilities used to construct the barplots displayed as part of the graph produced by plot("ctree"). For example, library(party) iris.ct <- ctree(Species ~ . , data = iris

Re: [R] Return value associated with a factor

2010-06-21 Thread Joris Meys
Code is not runnable, so can't check why it goes wrong, but tried already with as.character(save.tract$...) ? Cheers Joris On Mon, Jun 21, 2010 at 3:15 PM, GL wrote: > > I am using the code below to extract census tract information. > save.tract$state, save.tract$county and save.tract$tract are r

Re: [R] recurrent events data analysis

2010-06-21 Thread Terry Therneau
> > I am looking for code for modeling recurrent events with R, Especially > Andersen Gill Model /PWP models. I would greatly appreciate it if > anyone can > advise of refferences / books / other relevant information. thanks in > advance. The survival package does this in depth. For detailed ex

Re: [R] Replacing elements of a list over a certain threshold

2010-06-21 Thread Henrique Dallazuanna
Try this also: replace(example, example > threshold, threshold) On Mon, Jun 21, 2010 at 7:34 AM, Jim Hargreaves wrote: > Dear List, > > I have a list of length ~1000 filled with numerics. I need to replace the > elements of this list that are above a certain numerical threshold with the > value

Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-21 Thread Kjetil Halvorsen
One should also take into account the other R list. For example, as of today the number of subscribers to R-help-es (R-help for spanish speakers) is 290, increasing. Kjetil Halvorsen On Sun, Jun 20, 2010 at 6:28 PM, Muenchen, Robert A (Bob) wrote: > > >>-Original Message- >>From: r-help-

[R] Return value associated with a factor

2010-06-21 Thread GL
I am using the code below to extract census tract information. save.tract$state, save.tract$county and save.tract$tract are returned as factors. In the last three statements, I need to save the actual value of the factor, but, instead, the code is yielding the position of the factor. How do I inst

Re: [R] [OOPS] Re: Drawing sample from a circle

2010-06-21 Thread Ted Harding
I think you have misunderstood the code! In case [B] below (sampling uniformly over the area within the circle) the assignment r <- sqrt(runif(n)) does just that: The radius distribution (of r) is not uniform; the distribution of r^2 is uniform, and r^2 "is proportional to the circle area". In

[R] Play symbol

2010-06-21 Thread Florian Burkart
Hi together, I am looking to plot a play symbol (e.g. a triangle with the tip facing east) with the points command, but I noticed that this symbol is not available. Is there a way of turning symbol types 24 or 25 to face east? If not, what is the easiest way to achieve a play symbol? Thanks

Re: [R] Play symbol

2010-06-21 Thread Jim Lemon
On 06/21/2010 09:51 PM, Florian Burkart wrote: Hi together, I am looking to plot a play symbol (e.g. a triangle with the tip facing east) with the points command, but I noticed that this symbol is not available. Is there a way of turning symbol types 24 or 25 to face east? If not, what is the ea

Re: [R] Sweave cutting new lines

2010-06-21 Thread Florian Burkart
Hi Thierry, unfortunately, that does not seem to work for me. On 10/06/2010 14:19, ONKELINX, Thierry wrote: Hi Florian, Have you tried to replace each '\n' with '\r\n'. That did the trick for me. HTH, Thierry ir.

Re: [R] [OOPS] Re: Drawing sample from a circle

2010-06-21 Thread R Heberto Ghezzo, Dr
Sorry Ted The code for the circle is in error, the radius distribution should be proportional to the circle area not uniform. Better / simple to sample from the (-1,1) square uniformly and reject where x^2+y^2 > 1 Heberto From: r-help-boun...@r-project.org

[R] glm, poisson and negative binomial distribution and confidence interval

2010-06-21 Thread Stéphanie D'agata
Dear list, I am using glm's to predict count data for a fish species inside and outside a marine reserve for three different methods of monitoring. I run glms and figured out the best model using step function for each methods used. I predicted two values for my fish counts inside and outside the

[R] Re ZINB by Newton Raphson??

2010-06-21 Thread cahyo kristiono
Dear Mr.Zeileis & all. (1)     Thx for your reply. Yes, I am talk about the function zeroinfl() from the package "pscl". I want to use Newton Raphson to get parameter             estimation ZINB, so I try this:

Re: [R] Replacing elements of a list over a certain threshold

2010-06-21 Thread Joris Meys
You shouldn't use sapply/lapply for this but use the indices > set.seed(1) > r <- round(runif(10,1,10)) > treshold <- 5 > head(r) [1] 3 4 6 9 3 9 > system.time( r[ r>threshold ] <- threshold ) user system elapsed 0 0 0 > head(r) [1] 3 4 5 5 3 5 On Mon, Jun 21, 2010 a

Re: [R] Replacing elements of a list over a certain threshold

2010-06-21 Thread Christos Argyropoulos
Hi, You should use the sapply/lapply for such operations. > r<-round(runif(10,1,10)) > head(r) [1] 3 7 6 3 2 8 > filt<-function(x,thres) ifelse(x system.time(r2<-sapply(r,filt,thres=5)) user system elapsed 3.360.003.66 > head(r2) [1] 3 5 5 3 2 5 To return a list, replace "

Re: [R] replace NA-values

2010-06-21 Thread jim holtman
try 'na.locf' in the zoo package On Mon, Jun 21, 2010 at 7:52 AM, Patrick Hausmann wrote: > Dear list, > > I'm trying to replace NA-values with the preceding values in that column. > This code works, but I am sure there is a more elegant way... > > df <- data.frame(id = c("A1", NA, NA, NA, "B1",

[R] replace NA-values

2010-06-21 Thread Patrick Hausmann
Dear list, I'm trying to replace NA-values with the preceding values in that column. This code works, but I am sure there is a more elegant way... df <- data.frame(id = c("A1", NA, NA, NA, "B1", NA, NA, "C1", NA, NA, NA, NA), value = c(1:12)) rn <- c(rownam

[R] Latex outputs of multilevel models

2010-06-21 Thread Jonas
Hi, I have a number of multilevel models and I would like some Latex outputs of them. I usually use the "apsrtable" package, but it does not accept "lme" outputs. Neither does the "mtable" function in the "memisc" package. Is there any good alternative that I am missing? Thanks, Jonas ___

Re: [R] Java to R interface

2010-06-21 Thread iammyr
I know this is an old thread but, since the issue posted here has not been solved, if someone is still needing help, I suggest to have a loook at http://www.gisos.de/blog/articles/5/jri-and-eclipse-first-steps -- View this message in context: http://r.789695.n4.nabble.com/Java-to-R-interface-tp8

Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-21 Thread Duncan Murdoch
On 21/06/2010 2:49 AM, Peter Dalgaard wrote: Duncan Murdoch wrote: On 20/06/2010 6:36 PM, Muenchen, Robert A (Bob) wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Ivan Calandra Sent: Sunday, June 20, 2010

Re: [R] Spatial: number of independent components?

2010-06-21 Thread nikhil kaza
I have spdep 4.58. Perhaps it is deprecated in the new version. Try looking for sparse matrix representation in the help files for spdep Nikhil On Mon, Jun 21, 2010 at 6:10 AM, Daniel Malter wrote: > > as.spam.listw is an unknown function. Is it in a different package? > > Daniel > > other att

Re: [R] how to apply a panel function to each of several data series plotted on the same graph in lattice

2010-06-21 Thread Deepayan Sarkar
On Fri, Jun 18, 2010 at 5:19 PM, David Wyllie wrote: > Hi > > Thanks, but maybe I'm not making myself clear enough here. > I think I'm already doing what you suggest, below the line # plot with fits > .. in the original mail. > > I have made a little progress.  I wish to apply a panel function to

Re: [R] list() assigning the same value to two items

2010-06-21 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
Thanks, works as expected. But maybe I've to be a bit more clear about the reason why I'd like to have such a construct. In lattice you can define some parameters by passing a named list to par.settings. Suppose I want to superpose two lines and use colors different from the default: xyplot(

Re: [R] Replacing elements of a list over a certain threshold

2010-06-21 Thread Joris Meys
"magic" code: example[example>threshold] <-threshold Cheers Joris On Mon, Jun 21, 2010 at 12:34 PM, Jim Hargreaves wrote: > Dear List, > > I have a list of length ~1000 filled with numerics. I need to replace the > elements of this list that are above a certain numerical threshold with the > val

[R] Replacing elements of a list over a certain threshold

2010-06-21 Thread Jim Hargreaves
Dear List, I have a list of length ~1000 filled with numerics. I need to replace the elements of this list that are above a certain numerical threshold with the value of the threshold. e.g example=list(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1) threshold=5 example=(1, 2, 3, 4,

Re: [R] Spatial: number of independent components?

2010-06-21 Thread Daniel Malter
as.spam.listw is an unknown function. Is it in a different package? Daniel other attached packages: [1] spdep_0.5-11coda_0.13-5 deldir_0.0-12 maptools_0.7-34 foreign_0.8-38 nlme_3.1-96 MASS_7.3-3 [8] Matrix_0.999375-31 lattice_0.17-26 boot_1

Re: [R] list() assigning the same value to two items

2010-06-21 Thread Peter Ehlers
On 2010-06-21 3:30, Thaler, Thorn, LAUSANNE, Applied Mathematics wrote: Hi everybody, I'd like to have a list with two elements, where both elements have the same value: z<- list(a=1, b=1) If it happens, that I've to change the value, I've to assure that I change both. This is error prone. H

Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-21 Thread Joris Meys
On Mon, Jun 21, 2010 at 11:15 AM, Patrick Burns wrote: > > (Statistics is what stuffy professors > do, I just look at my data and try to > figure out what it means.) Often those stuffy professors have a reason to do so. When they want an objective view on the data for example, or an objective mea

[R] list() assigning the same value to two items

2010-06-21 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
Hi everybody, I'd like to have a list with two elements, where both elements have the same value: z <- list(a=1, b=1) If it happens, that I've to change the value, I've to assure that I change both. This is error prone. Hence, a better way to achieve this is to define: tmp <- 1 z <- list(a=tm

Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-21 Thread Patrick Burns
I think there is a problem with the question: Not everyone thinks of R as a statistics program. Furthermore, I don't think it should be thought of as a statistics program. (Statistics is what stuffy professors do, I just look at my data and try to figure out what it means.) On 20/06/2010 23:46

  1   2   >