[R] Fwd: Re: Combine matrix

2007-08-17 Thread Moshe Olshansky
Note: forwarded message attached. Mistakenly I did not send this to the list! ---BeginMessage--- Here is a solution which (I think) works, but it contains a loop which most likely can be eliminated by more knowledgable people): Let a and b be like in your example but to make things more

Re: [R] [BioC] function to find coodinates in an array

2007-08-17 Thread Ana Conesa
The arr.ind in the which function does the job very nicely!!! Thank you everyone for the suggestions! Ana Mensaje Original De: [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Asunto: Re: [BioC] [R] function to find coodinates in an array Fecha: Thu, 16 Aug 2007 21:53:44 -0500 If I am

[R] R graphics display window

2007-08-17 Thread Felipe Carrillo
Hi all: How can the R graphics window be customized programmatically? Either minimized,maximized or change the size of the default that ships with R. Thanks Felipe D. Carrillo Fishery Biologist US Fish Wildlife Service Red Bluff, California 96080

Re: [R] R graphics display window

2007-08-17 Thread Dieter Menne
Felipe Carrillo mazatlanmexico at yahoo.com writes: How can the R graphics window be customized programmatically? Either minimized,maximized or change the size of the default that ships with R. Assuming Windows as OS (which you forgot to mention) windows(width = 2, height = 2, pointsize =

[R] residual plots for lmer in lme4 package

2007-08-17 Thread Margaret Gardiner-Garden
Hi, I was wondering if I might be able to ask some advice about doing residual plots for the lmer function in the lme4 package. (Apologies to anyone who has received this message twice. I have had problems with embedded text.) Our group's aim is to find if the expression staining of a

Re: [R] for plots

2007-08-17 Thread Dieter Menne
jim holtman jholtman at gmail.com writes: Turn 'Recording on for the plots. windows(record=TRUE) or select from the GUI. I mean if the object has several plots how can I get those? gam.object - gam(y ~ s(x,6) + z,data=gam.data) plot(gam.object,se=TRUE) Or use something like

Re: [R] function to find coodinates in an array

2007-08-17 Thread Martin Maechler
GaGr == Gabor Grothendieck [EMAIL PROTECTED] on Thu, 16 Aug 2007 23:46:28 -0400 writes: GaGr Get the indices using expand.grid and then reorder GaGr them: set.seed(1); X - array(rnorm(24), 2:4) # input GaGr X # look at X GaGr do.call(expand.grid, sapply(dim(X),

Re: [R] several plots on several pages - bug in par(mfg())?

2007-08-17 Thread Rainer M. Krug
Greg Snow wrote: Oops, I read further down in your original post and see that you already knew about par(mfg=c(2,1)). To get it to advance to page 2 for the 4th plot try calling plot.new() which should move you to the next page, then doing par(mfg=c(1,1)) should cause the next graph to be at

[R] Odp: beta distrib function was(no subject)

2007-08-17 Thread Petr PIKAL
Hi you do not give much information, even subject line is missing. Try to follow posting guide and try to explain what you did and how did you fail. Regards Petr [EMAIL PROTECTED] napsal dne 16.08.2007 17:24:24: hi, i'm new to R and i'm trying to port a quattro pro spreadsheet into R.

Re: [R] for plots

2007-08-17 Thread S Ellison
?plot.gam or ?preplot.gam says there is an ask= option, slightly bizarrely set to F by default. If ask=T, You'll get a menu of options for plotting. In windows, hitting Esc will get you out of the menu. example: gam(Kyphosis ~ s(Age,4) + Number, family = binomial, data=kyphosis, trace=TRUE)

Re: [R] combining P values using Fisher's method

2007-08-17 Thread Patrick Burns
Page 14 of the working paper http://www.burns-stat.com/pages/Working/perfmeasrandport.pdf gives an example of why you might not want to use Fisher's method, and it gives R code for Stouffer's method. Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry

Re: [R] Question about sm.options sm.survival

2007-08-17 Thread Prof Brian Ripley
On Thu, 16 Aug 2007, Rachel Jia wrote: Hi, there: It's my first time to post question in this forum, so thanks for your tolerance if my question is too naive. I am using a nonparametric smoothing procedure in sm package to generate smoothed survival curves for continuous covariate. I want

Re: [R] residual plots for lmer in lme4 package

2007-08-17 Thread John Maindonald
I am doubtful whether standard residual plots are very useful in this context. One wants the theoretical effects Ui to have a normal distribution. If there are similar amounts of information on each patient, maybe it will not be too bad to extract the estimated effects and check them for

[R] Date format on x-axis

2007-08-17 Thread inaki
Dear R users, Plotting question from a R beginner... When I try to plot a response through time, for example: Date-c(2006-08-17, 2006-08-18, 2006-08-19, 2006-08-20) response-c(4,4,8,12) as.Date(Date) plot(Date,response) The dates on the graphic appear in spanish. This I guess is the default way

Re: [R] R graphics display window

2007-08-17 Thread Duncan Murdoch
On 16/08/2007 7:35 PM, Felipe Carrillo wrote: Hi all: How can the R graphics window be customized programmatically? Either minimized,maximized or change the size of the default that ships with R. Which device are you working with? Most of them allow the size to be selected in the initial

Re: [R] multiple colors within same line of text

2007-08-17 Thread John Kane
Hi Andrew, This is pretty clumsy but it seems to work. I suspect there are many better ways x - seq(0, 1, length=21) plot(db) colour - c(red, blue) mytext - c(RED, BLUE) mtext( mytext, at= c(2,5), side=1, col=colour) --- Andrew Yee [EMAIL PROTECTED] wrote: Hi, I'm interested in using

[R] Quadratic Programming

2007-08-17 Thread Tobias Schlottmann
Hi there, Is it basically possible to solve a non-convex quadratic programming with optimal solution by any way? What could be the way? How can be this problem dealt with? Could you guide me to some references please? I thank you very much for eny help. Tobi

Re: [R] multiple colors within same line of text

2007-08-17 Thread John Kane
Correction x - seq(0, 1, length=21) db - dbeta(x, 3,1) plot(db) colour - c(red, blue) mytext - c(RED, BLUE) mtext( mytext, at= c(2,5), side=1, col=colour) --- John Kane [EMAIL PROTECTED] wrote: Hi Andrew, This is pretty clumsy but it seems to work. I suspect there are many better ways

Re: [R] Date format on x-axis

2007-08-17 Thread Prof Brian Ripley
If you want to use English, you need to set your session to be use English. PLEASE do read the posting guide http://www.R-project.org/posting-guide.html We need to know your OS and locale, and you did not follow the guide. On a Unix-alike probably Sys.setlocale(LC_TIME,en_US) or

[R] installation of the gsl package on Suse 10.1

2007-08-17 Thread luca laghi
I am trying to install the gsl package. I had gsl installed with YaSt in /usr/lib. when I launch R as superuser and launch install.packages, it says in cannot find Gnu Scientific Library. How can I make it find them? Thank you, Luca Laghi __

Re: [R] Date format on x-axis

2007-08-17 Thread inaki
OK, solved!!! Thanks again! Inaki Perhaps: lct - Sys.getlocale(LC_TIME) Sys.setlocale(LC_TIME, English) format.Date(Date, %b-%Y) For restore the configurations: Sys.setlocale(LC_TIME, lct) -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40 S 49° 16' 22 O On 17/08/07, [EMAIL

Re: [R] Date format on x-axis

2007-08-17 Thread Henrique Dallazuanna
Perhaps: lct - Sys.getlocale(LC_TIME) Sys.setlocale(LC_TIME, English) format.Date(Date, %b-%Y) For restore the configurations: Sys.setlocale(LC_TIME, lct) -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40 S 49° 16' 22 O On 17/08/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Dear R

Re: [R] installation of the gsl package on Suse 10.1

2007-08-17 Thread Prof Brian Ripley
On Fri, 17 Aug 2007, luca laghi wrote: I am trying to install the gsl package. I had gsl installed with YaSt in /usr/lib. when I launch R as superuser and launch install.packages, it says in cannot find Gnu Scientific Library. How can I make it find them? Please tell us the exact messages

Re: [R] [BioC] function to find coodinates in an array

2007-08-17 Thread Marc Schwartz
Ana, Two quick comments: 1. Needless to say, my use of 'ARR[order(ARR)]' can of course be simplified to 'sort(ARR)'. For some reason, I got fixated on your use of order() last night. 2. I suspect that you will find Gabor's solution to be superior to mine. Most notably because I neglected to

[R] export to txt

2007-08-17 Thread [EMAIL PROTECTED]
I just used the table () function for building a presence/absence matrix of plots vs. species Now I would like to export the result to a txt file. Thanks Duccio __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] export to txt

2007-08-17 Thread Henrique Dallazuanna
write.table(yourtable, file.txt, quote=F) -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40 S 49° 16' 22 O On 17/08/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I just used the table () function for building a presence/absence matrix of plots vs. species Now I would like to

[R] matching elements from two vectors

2007-08-17 Thread Gonçalo Ferraz
Hi, Imagine a vector x with elements (1,2,1,1,3,5,3,3,1) and a vector y with elements (2,3). I need to find out what elements of x match any of the elements of y. Is there a simple command that will return a vector with elements (F,T,F,F,T,F,T,T,F). Ideally, I would like a solution that works

Re: [R] for plots

2007-08-17 Thread Julian M Burgos
Hi Jim, You could also use the 'select' argument. For example, plot(gam.object,se=TRUE,select=1) will give you the smooth plot for the first variable. Be sure to read the documentation. See ?plot.gam for specifics details on plotting gam objects. Julian On Fri, 17 Aug 2007, Dieter Menne

Re: [R] matching elements from two vectors

2007-08-17 Thread davidr
x %in% y David L. Reiner Rho Trading Securities, LLC -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gonçalo Ferraz Sent: Friday, August 17, 2007 9:46 AM To: r-help@stat.math.ethz.ch Subject: [R] matching elements from two vectors Hi, Imagine a vector

[R] superposing lattice plots

2007-08-17 Thread jiho
Hello everyone, I am sorry if this has already been asked but I can't find it. I want to superpose two lattice plots, namely a levelplot and a contourplot of two different variables with the same x-y scale. I found information about panel.superpose but it does not seem to correspond to

Re: [R] matching elements from two vectors

2007-08-17 Thread jim holtman
x - c(1,2,1,1,3,5,3,3,1) y - c(2,3) intersect(x,y) [1] 2 3 On 8/17/07, Gonçalo Ferraz [EMAIL PROTECTED] wrote: Hi, Imagine a vector x with elements (1,2,1,1,3,5,3,3,1) and a vector y with elements (2,3). I need to find out what elements of x match any of the elements of y. Is there a

Re: [R] matching elements from two vectors

2007-08-17 Thread Henrique Dallazuanna
Hi! v1 - c(1,2,1,1,3,5,3,3,1) v2 - c(2,3) v1 %in% v2 -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40 S 49° 16' 22 O On 17/08/07, Gonçalo Ferraz [EMAIL PROTECTED] wrote: Hi, Imagine a vector x with elements (1,2,1,1,3,5,3,3,1) and a vector y with elements (2,3). I need to find

[R] New version of The R Guide available on CRAN

2007-08-17 Thread Owen, Jason
Hello, A newly-revised version of my introductory manual The R Guide is now available in the Contributed Documents section in CRAN. Among other changes, the description of the function t.test() has been expanded as well as an introduction to methods for the creation of prediction and confidence

Re: [R] matching elements from two vectors

2007-08-17 Thread jim holtman
Also if you want all the matches x[x %in% y] [1] 2 3 3 3 On 8/17/07, Gonçalo Ferraz [EMAIL PROTECTED] wrote: Hi, Imagine a vector x with elements (1,2,1,1,3,5,3,3,1) and a vector y with elements (2,3). I need to find out what elements of x match any of the elements of y. Is there a

Re: [R] matching elements from two vectors

2007-08-17 Thread Gonçalo Ferraz
Thanks much. x %in% y works. On 8/17/07, jim holtman [EMAIL PROTECTED] wrote: Also if you want all the matches x[x %in% y] [1] 2 3 3 3 On 8/17/07, Gonçalo Ferraz [EMAIL PROTECTED] wrote: Hi, Imagine a vector x with elements (1,2,1,1,3,5,3,3,1) and a vector y with elements (2,3).

[R] svyglm.predict: cannot allocate vector

2007-08-17 Thread Werner Wernersen
Hi, I have a problem with the predict function of svyglm: When I try to predict with an object of svyglm I get the error message that R can't allocate a vector about 3 GB big. Has anybody a hint how I can reduce the memory used for this? I have about 25000 observation and use the weigths

Re: [R] Is there any good tools to facilitate us to create R functions?

2007-08-17 Thread Uwe Ligges
zhijie zhang wrote: Dear R users, We have some programs for the specific task in our research, but they were very commonly used. We want to make some functions for them, anybody can recommend any good tools to facilitate us to create R functions even without going deep into the theories

Re: [R] (no subject)

2007-08-17 Thread Ben Bolker
mara serrano teachermara at yahoo.com writes: hi, i'm new to R and i'm trying to port a quattro pro spreadsheet into R. spreadsheets have optional lower and upper limit parameters on the beta distribution function. i would like to know how to incorporate this with R's pbeta function.

Re: [R] matching elements from two vectors

2007-08-17 Thread Martin Maechler
GF == Gonçalo Ferraz [EMAIL PROTECTED] on Fri, 17 Aug 2007 11:03:09 -0400 writes: GF Thanks much. x %in% y works. yes, indeed. But I wonder a bit why nobody remarked on the facts that 1) you use match in the subject of your e-mail 2) match() is the basic ingredient you use: '%in%'

[R] problem using rank

2007-08-17 Thread Jiong Zhang, PhD
Hi All, I had 12766 elements in a column, 12566 are values and 200 are NAs. I used the following line to get the ranks: total_list$MB.rank - rank(-total_list$MB,ties.method=min,na.last=NA) but I got an error message: Error in `$-.data.frame`(`*tmp*`, BCRP_PW_F.rank, value = c(3949, 6182, :

Re: [R] names not inherited in functions

2007-08-17 Thread david dav
Dear R list, After a huge delay, I come back to this question. Using names of variables inside a function is a problem I run into quite often. Maybe this little example should help to get my point: Suppose I want to make a function llabel to get the labels of the variables from a data frame. If no

Re: [R] problem using rank

2007-08-17 Thread Henrique Dallazuanna
Hi, try this: total_list$MB.rank[!is.na(toal_list$MB)] - rank(-total_list$MB,ties.method= min,na.last=NA) -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40 S 49° 16' 22 O On 17/08/07, Jiong Zhang, PhD [EMAIL PROTECTED] wrote: Hi All, I had 12766 elements in a column, 12566 are

Re: [R] Linear models over large datasets

2007-08-17 Thread Ravi Varadhan
The simplest trick is to use the QR decomposition: The OLS solution (X'X)^{-1}X'y can be easily computed as: qr.solve(X, y) Here is an illustration: set.seed(123) X - matrix(round(rnorm(100),1),20,5) b - c(1,1,2,2,3) y - X %*% b + rnorm(20) ans1 - solve(t(X)%*%X,t(X)%*%y) ans2 -

Re: [R] problem using rank

2007-08-17 Thread Prof Brian Ripley
On Fri, 17 Aug 2007, Jiong Zhang, PhD wrote: Hi All, I had 12766 elements in a column, 12566 are values and 200 are NAs. I used the following line to get the ranks: total_list$MB.rank - rank(-total_list$MB,ties.method=min,na.last=NA) but I got an error message: Error in

Re: [R] names not inherited in functions

2007-08-17 Thread Gabor Grothendieck
Within a function deparse(substitute(x)) will give the name of x, as a character variable. Search the archives for deparse substitute to find many examples. On 8/17/07, david dav [EMAIL PROTECTED] wrote: Dear R list, After a huge delay, I come back to this question. Using names of variables

Re: [R] names not inherited in functions

2007-08-17 Thread Charles C. Berry
David, I think you are looking for deparse(substitute(var)) See ?deparse Notice in ?data.frame this bit: ...: these arguments are of either the form 'value' or 'tag = value'. Component names are created based on the tag (if present) or

[R] image plot with multiple x values

2007-08-17 Thread baptiste Auguié
Hi, New to R, I don't find a way to plot the following data with image(): x is a N * M matrix y is a vector of length M z is a N*M matrix I wish to plot z as a greyscale image, but my x axis is different for every row of the z data. Here is a minimal example, theta-c(3:6) # N y-c(1:5) # M

Re: [R] Linear models over large datasets

2007-08-17 Thread Charles C. Berry
The original complaint What exactly are my options to improve this? I looked into the biglm package but the problem with it is it uses update() function and is therefore not transparent is not warranted. As usual, the source code is the best reference. It took about a minute to download

Re: [R] Linear models over large datasets

2007-08-17 Thread Daniel Lakeland
On Fri, Aug 17, 2007 at 01:53:25PM -0400, Ravi Varadhan wrote: The simplest trick is to use the QR decomposition: The OLS solution (X'X)^{-1}X'y can be easily computed as: qr.solve(X, y) While I agree that this is the correct way to solve the linear algebra problem, I seem to be missing the

Re: [R] names not inherited in functions

2007-08-17 Thread Duncan Murdoch
On 8/17/2007 1:17 PM, david dav wrote: Dear R list, After a huge delay, I come back to this question. Using names of variables inside a function is a problem I run into quite often. Maybe this little example should help to get my point: Suppose I want to make a function llabel to get the

[R] Linear models over large datasets

2007-08-17 Thread dave fournier
Its actually only a few lines of code to do this from first principles. The coefficients depend only on the cross products X'X and X'y and you can build them up easily by extending this example to read files or a database holding x and y instead of getting them from the args. Here we process

Re: [R] image plot with multiple x values

2007-08-17 Thread Daniel Lakeland
On Fri, Aug 17, 2007 at 07:51:59PM +0100, baptiste Augui? wrote: Hi, New to R, I don't find a way to plot the following data with image(): ... This doesn't give what I want, as the x axis needs to be shifted as we go from line to the following. (probably clearer if you plot

Re: [R] image plot with multiple x values

2007-08-17 Thread roger koenker
If you are willing to go to the bother of representing your data as a sparse matrix, the package SparseM has a version of image() that will do what you would like to do, I believe. url:www.econ.uiuc.edu/~rogerRoger Koenker email[EMAIL PROTECTED]Department of

Re: [R] Is there any good tools to facilitate us to create R functions?

2007-08-17 Thread Francisco J. Zagmutt
Hello Zhijie, You can many specific commands and tricks by using R commander's menus: install.packages(Rcmdr) library(Rcmdr) However, I can not stress enough that if you want to be proficient and sound in your work with R, you will have to invest time reading the documentation (see

[R] finding the row(s) for a date in a data frame

2007-08-17 Thread Gonçalo Ferraz
Hi, If I have a data frame A with the following format: Day1 Day2 Day3 Day4 1 1979-11-02 1979-11-03 1979-11-04 NA 2 1979-12-06 NA NA NA 3 1979-12-13 1979-12-14 1979-12-15 1979-12-16 4 1979-12-20 NA NA NA

Re: [R] (Ben Bolker) AIC and logLik for logistic regression in R and S-PLUS

2007-08-17 Thread Leandra Desousa
Leandra Desousa sousa at ims.uaf.edu writes: I am using 'R' version 2.2.1 and 'S-PLUS' version 6.0; and I loaded the MASS library in 'S-PLUS'. I am running a logistic regression using glm: summary(mydata.glm) Call: glm(formula = COMU ~ MeanPycUpT + MeanPycUpS, family = binomial,data

[R] How to create several variables from composite character variable

2007-08-17 Thread Dale Steele
I'm trying to create two variables (dka and newsonset) from the following composite character variable diagnosis: diagnosis - c(hypoglycemia,diabetes ,newonsetdka, newonset, diabetes, dkaGI, diabetesGI, newonset, dka) I can extract the indices for dka and newonset using the following

Re: [R] How to create several variables from composite character variable

2007-08-17 Thread Daniel Lakeland
On Fri, Aug 17, 2007 at 05:32:54PM -0400, Dale Steele wrote: I'm trying to create two variables (dka and newsonset) from the following composite character variable diagnosis: diagnosis - c(hypoglycemia,diabetes ,newonsetdka, newonset, diabetes, dkaGI, diabetesGI, newonset, dka) I can

Re: [R] How to create several variables from composite character variable

2007-08-17 Thread Marc Schwartz
On Fri, 2007-08-17 at 14:40 -0700, Daniel Lakeland wrote: On Fri, Aug 17, 2007 at 05:32:54PM -0400, Dale Steele wrote: I'm trying to create two variables (dka and newsonset) from the following composite character variable diagnosis: diagnosis - c(hypoglycemia,diabetes ,newonsetdka,

Re: [R] finding the row(s) for a date in a data frame

2007-08-17 Thread Weiwei Shi
try this, and you will get a clue: (today - Sys.Date()) [1] 2007-08-17 class(today) [1] Date as.Date(2007-08-17) == today [1] TRUE so basically, your.target = as.Date(1979-12-14) apply(A, c(1,2), function(x) x==your.target)) # should work. I did not test though. HTH, Weiwei On 8/17/07,

Re: [R] Possible memory leak with R v.2.5.0

2007-08-17 Thread Peter Waltman
Hi Martin (and others, hopefully ) - Upon your suggestion, I tried your code and did not see a leak, and this was reflected by the 'top' command. However, I modified your code snippet below to make it a little closer to what I'm actually doing, and can now reproducibly cause the leak that I'm

Re: [R] Is there any good tools to facilitate us to create R functions?

2007-08-17 Thread Weiwei Shi
Your question is well un-defined. Specify your question, maybe by an example so we can help. You can also send me personal email if you want. I graduate from Fudan too, so I would like to give a favor, lol Best, Weiwei On 8/17/07, zhijie zhang [EMAIL PROTECTED] wrote: Dear R users, We have

Re: [R] Quadratic Programming

2007-08-17 Thread Francisco J. Zagmutt
Read the posting guide at http://www.R-project.org/posting-guide.html and try the suggestions under Do your homework before posting: You probably won't have to go past bullet 3 to find the answer to your question. Regards, Francisco Tobias Schlottmann wrote: Hi there, Is it

Re: [R] several plots on several pages - bug in par(mfg())?

2007-08-17 Thread Francisco J. Zagmutt
Hello Rainer, You need to catch the cases where the call to plot generates an error. Using your example: ## Set layout to three rows and only one column par( mfcol=c(3,1), oma=c(0,0,0,0), mar=c(4, 4, 2, 2) ) ## First row par(mfg=c(1,1)) er-try( plot(runif(ff)), silent=T ) ## plot fails due to