Re: [R] predict.lm(...,type=terms) question

2012-09-02 Thread peter dalgaard
On Sep 2, 2012, at 03:38 , David Winsemius wrote: Why should predict not complain when it is offered a newdata argument that does no contain a vector of values for x? The whole point of the terms method of prediction is to offer estimates for specific values of items on the RHS of the

Re: [R] (Newbie) help cannot find chrome

2012-09-02 Thread Bert Gunter
?options options(browser) - ## whatever If you don't know how to use the Help system, read the Intro to R tutorial -- ot type ?help at the command prompt in interactive mode fpr the help for help. -- Bert On Sat, Sep 1, 2012 at 2:39 PM, Carilda Thomas carilda.tho...@gmail.comwrote: Following

Re: [R] (Newbie) help cannot find chrome

2012-09-02 Thread Bert Gunter
I should have added ?help.start tells you what I did already. So you should make it your first order of business to learn to use R's Help system. -- Bert On Sat, Sep 1, 2012 at 2:39 PM, Carilda Thomas carilda.tho...@gmail.comwrote: Following the beginning tutorial, I typed help.start() and

[R] glmulti runs indefinitely when using genetic algorithm with lme4

2012-09-02 Thread Thomas
Dear List, I'm using glmulti for model averaging in R. There are ~10 variables in my model, making exhaustive screening impractical - I therefore need to use the genetic algorithm (GA) (call: method = g). I need to include random effects so I'm using glmulti as a wrapper for lme4.

[R] Help on finding specific columns in matrix

2012-09-02 Thread Andras Farkas
Dear All,   I have a matrix with 33 columns and 5000 rows. I would like to find 2 specific columns in the set: the one that holds the highest values and the one that holds the lowest values. In this case the column's mean would be apropriate to use to try to find those specific columns because

[R] for help post-hoc comparisons

2012-09-02 Thread Luo Yinling
Dear R community In my experiment, there are three treatments (F, R, and S), and the storge temperatures of these seeds were 4, 10 and 15. The seeds number of the treatment were the same. The question is whether the treatments and storage temperatures changed the seed germinating. The

[R] aov(rt~(F1*F2*F3)+Error(s/(F1*F2*F3)), three_way) question + data

2012-09-02 Thread David G
Dear list members, I am picking up some experimental data that was collected last year and analysed using a within subject repeated measure ANOVA using SPSS (glm). There are 3 factors (F1, F2, F3), each with 2 levels (foc - per; on - off; l - r) recorded within a balanced 2x2x2 design. I want to

Re: [R] Help on finding specific columns in matrix

2012-09-02 Thread Rainer Schuermann
If I understand your question correctly, you want to identify the one column that has the lowest mean of all columns, and the one column that has the highest mean of all columns. Using your provided sample data, this gives you the indices: colMeans(a) [1] 12.48160 17.46868 22.51761 27.59880

Re: [R] Computing 'exp(1e3)*0' correctly....

2012-09-02 Thread CHEL HEE LEE
I very appreciate for good comments and tip regarding my question. All postings are excellent to know when I am writing such expression in R. Thank you so much, and my question is completely resolved from all your postings. On Sun, 2012-09-02 at 00:50 +0100, Rui Barradas wrote: Em 02-09-2012

Re: [R] splits with 0s in middle columns

2012-09-02 Thread Rui Barradas
Hello, You don't need a new function, what you need is to prepare your data in such a way that the function can process it. A - c(percent (10/20/30), percent (40/20), percent (60/10/10/5), percent (80/10)) B - gsub(\\(|\\)|percent| , , A) fun(B) Also, please use dput to post the data

Re: [R] for help post-hoc comparisons

2012-09-02 Thread David Winsemius
On Sep 2, 2012, at 12:16 AM, Luo Yinling wrote: Dear R community In my experiment, there are three treatments (F, R, and S), and the storge temperatures of these seeds were 4, 10 and 15. The seeds number of the treatment were the same. The question is whether the treatments and

[R] most efficient plyr solution

2012-09-02 Thread Philip de Witt Hamer
Dear list members, Any help on this efficiency issue would be greatly appreciated. I would like to find the most efficient way to run a non-vectorized function (here: fisher exact test p-value) iteratively using 4 matrices with identical dimensions. And as a result I aim for an array with

Re: [R] glmulti runs indefinitely when using genetic algorithm with lme4

2012-09-02 Thread Thomas
Right, I've worked this one out - the problem is that the example (above) I was using to test run this package only contains 3 variables. When you add in a fourth it works fine: d = runif(30) And run again telling it to use GA: babs - glmulti(y~a*b*c*d, level = 2, fitfunc =

Re: [R] Help on finding specific columns in matrix

2012-09-02 Thread arun
Hi, Try this:  which.min(apply(a,2,mean)) #[1] 1  which.max(apply(a,2,mean)) #[1] 4 A.K. - Original Message - From: Andras Farkas motyoc...@yahoo.com To: r-help@r-project.org r-help@r-project.org Cc: Sent: Sunday, September 2, 2012 5:49 AM Subject: [R] Help on finding specific columns

Re: [R] R_closest date

2012-09-02 Thread arun
Hi, No problem. If you use join() instead of merge(), the original order of columns may not get altered. dat3-aggregate(DAYS_DIFF~PT_ID,data=dat1,min) library(plyr)  join(dat1,dat3,type=inner) #Joining by: PT_ID, DAYS_DIFF  # PT_ID IDX_DT   OBS_DATE DAYS_DIFF OBS_VALUE CATEGORY #1  4549

[R] Simulation of genetic data

2012-09-02 Thread james power
Hi, I am looking for the best way or best package available for simulating a genetic association between a specific SNP and a quantitative phenotype. All of the packages I saw in R seem to be specialised in pedigree data or in population data where coalescence and other evolutionary factors are

Re: [R] predict.lm(...,type=terms) question

2012-09-02 Thread John Thaden
Thank you all. My muddle about predict.lm(..., type = terms) was evident even in my first sentence of my original posting How can I actually use the output of predict.lm(..., type=terms) to predict new term values from new response values? the answer being that I cannot; that new response

[R] Loading Chess Data

2012-09-02 Thread David Arnold
All, What would be the most efficient way to load the data at the following address into a dataframe? http://ratings.fide.com/top.phtml?list=men Thanks, David -- View this message in context: http://r.789695.n4.nabble.com/Loading-Chess-Data-tp4642006.html Sent from the R help mailing list

[R] Impact of cex changing as a function of mfrow

2012-09-02 Thread Dennis Fisher
R 2.15.1 OS X (MLion) Colleagues, I am aware that changes in mfrow / mfcol in par() affect cex (from help: In a layout with exactly two rows and columns the base value of ‘cex’ is reduced by a factor of 0.83: if there are three or more of either rows or columns, the reduction factor is 0.66).

Re: [R] Loading Chess Data

2012-09-02 Thread jones
You might take a look at the link titled Download Rating List, in the blue box on the right side of that page... albyn On 2012-09-02 9:41, David Arnold wrote: All, What would be the most efficient way to load the data at the following address into a dataframe?

Re: [R] Loading Chess Data

2012-09-02 Thread Hasan Diwan
Mr Arnold, What would be the most efficient way to load the data at the following address into a dataframe? To what end? In other words, what are you trying to achieve with the ratings list? -- H -- Sent from my mobile device Envoyait de mon portable [[alternative HTML version

[R] why variations in accuracy between R to ARCGIS for the same point reprojection?

2012-09-02 Thread Camilo Mora
Hi everyone, I wonder if anyone knows the reason why the outputs of the same reprojection in r and arcgis are different?. The magnitude of the change can be up to 40 km in the poles. Basically, I have a database of points equally separated by one degree over the globe. In ARCGIS, I am

Re: [R] Impact of cex changing as a function of mfrow

2012-09-02 Thread Duncan Murdoch
On 12-09-02 1:40 PM, Dennis Fisher wrote: R 2.15.1 OS X (MLion) Colleagues, I am aware that changes in mfrow / mfcol in par() affect cex (from help: In a layout with exactly two rows and columns the base value of ‘cex’ is reduced by a factor of 0.83: if there are three or more of either rows

Re: [R] why variations in accuracy between R to ARCGIS for the same point reprojection?

2012-09-02 Thread Prof Brian Ripley
There is no 'reprojection' in R (which is upper case). Please attribute blame correctly. You seem to be talking about some contributed addon package, not specified. But I think you should be asking this on R-sig-geo. On 02/09/2012 19:24, Camilo Mora wrote: Hi everyone, I wonder if anyone

Re: [R] predict.lm(...,type=terms) question

2012-09-02 Thread Rui Barradas
Hello, In the mean time, I've discovered an R package that might do the job, chemCal. It only implements first order linear regression (weighted), and like I'd said in my first reply, and was repeated several times, the standard errors are not reversed, the prediction bands follow Massart et

Re: [R] Loading Chess Data

2012-09-02 Thread Rui Barradas
Hello, Try the following library(XML) url - http://ratings.fide.com/top.phtml?list=men; chess - readHTMLTable(url, header = TRUE, which = 5) str(chess) # See what we have # All variables are factors, # convert these to integer chess$Rating - as.integer(chess$Rating) chess$Games -

Re: [R] Impact of cex changing as a function of mfrow

2012-09-02 Thread Dennis Fisher
Duncan Perhaps I did not explain sufficiently -- the code that I sent makes the correction in FINDCEX. But, that correction does not accomplish the intended goal -- as evidenced by the graphic that is created from the code that I sent. The option of brute force would require trial and error.

Re: [R] Impact of cex changing as a function of mfrow

2012-09-02 Thread Duncan Murdoch
On 12-09-02 3:52 PM, Dennis Fisher wrote: Duncan Perhaps I did not explain sufficiently -- the code that I sent makes the correction in FINDCEX. But, that correction does not accomplish the intended goal -- as evidenced by the graphic that is created from the code that I sent. The option of

[R] [newbie] scripting remote check for R package

2012-09-02 Thread Tom Roche
summary: e.g., how to replace 'query R for package=package_name' in the following: for RSERVER in 'foo' 'bar' 'baz' ; do ssh ${RSERVER} 'query R for package=package_name' done or is there a better way to script checking for an R package? details: For my work I need a few non-standard R

Re: [R] NANs in test Breslow-Day for svytable??

2012-09-02 Thread Diana Marcela Martinez Ruiz
Hello, Thanks for the indications for use epi.2by2 in svytable, however when running the code throws warnings that reference NANs, could help me with this? Following you show the results: int19-svytable(~Perdida_peso_no_intensionada+APES_DICOT+tabaco,Muestra.comp,Ntotal = NULL) int19 , ,

Re: [R] why variations in accuracy between R to ARCGIS for the same point reprojection?

2012-09-02 Thread Camilo Mora
I apologize, I did not intend to blame anyone. I actually thought there may be some underlying differences in the formulas used. The patterns overall are very similar but they are not that precise to one another. The function I use in r is called spTransform from the package rgdal.

[R] a newbie seeking for a simple problem

2012-09-02 Thread Hon Kit (Stephen) Wong
Dear Experienced R users, I have a looks-like simple but complicated problem urgently needed to be solved. Below is the detail: I have two dataframes, df1, df2. df1 contains two column and many thousands rows: column 1 is a gene_name, column 2 is value. df2 contains only one column which is

Re: [R] a newbie seeking for a simple problem

2012-09-02 Thread Jeff Newmiller
Read the posting guide... you need to provide more specific information such as sample data (?dput). For this problem you should probably read ?merge --- Jeff NewmillerThe . . Go

Re: [R] Impact of cex changing as a function of mfrow

2012-09-02 Thread Fisher Dennis
Duncan I are getting closer to an understanding. 1. index is not relevant to the discussion. i am focused solely on margin text 2. the size pf the margin text does not change between pages 3. however, the location does change, moreso on the top / right than on the

Re: [R] splits with 0s in middle columns

2012-09-02 Thread Rui Barradas
Hello, You should Cc the list, there are others presenting solutions. What's going on should be obvious, your data example had percent in it, and your data file has slope! How could you expect it to work? Just in case, I'm changing the regular expression to removing everything but bars and

[R] Skew-Normal CDF using psn

2012-09-02 Thread Boris Beranger
Dear R-users, I have been using the code below in order to verify how the CDF of a skew-normal distribution was calculated: library(sn) s=seq(-30,30,by=0.1) a-matrix(nrow=length(s),ncol=5) lambda=1 for(i in 1:length(s)){ a[i,1]=pnorm(s[i],mean=0,sd=1); a[i,2]=T.Owen(s[i],lambda);

[R] Common elements in columns

2012-09-02 Thread Silvano Cesar da Costa
Hi, I have 4 files with 1 individuals in each file and 10 columns each. One of the columns, say C1, may have elements in common with the other columns C1 of other files. If I have only 2 files, I can do this check with the command: data1[data1 %in% data2] data2[data2 %in% data1] How do I

Re: [R] splits with 0s in middle columns

2012-09-02 Thread arun
HI, You can also try this as a function: fun1-function(x){ B-gsub(percent{0,1}\\s\\((.*)\\),\\1,x) C-gsub((.*)/(.*),\\1 0 0 \\2, gsub((.*)/(.*)/(.*),\\1 \\2 0 \\3, gsub((.*)/(.*)/(.*)/(.*),\\1 \\2 \\3 \\4,B))) dat1-data.frame(do.call(rbind,strsplit(C, ))) colnames(dat1)-paste0(A,1:4) dat1 }  

Re: [R] Help on finding specific columns in matrix

2012-09-02 Thread arun
HI Andras, No problem.  But, i guess using colMeans() as suggested by Rainer should be faster in large datasets. A.K. - Original Message - From: Andras Farkas motyoc...@yahoo.com To: smartpink...@yahoo.com Cc: Sent: Sunday, September 2, 2012 4:59 PM Subject: Re: [R] Help on finding

Re: [R] [newbie] scripting remote check for R package

2012-09-02 Thread Daróczi Gergely
I would call something like this via ssh (please note: I used ggplot2 in the example): Rscript -e 'as.numeric(suppressWarnings(suppressPackageStartupMessages(require(ggplot2' You could easily extend this to loop through the required packages and tweak the output for your needs. Best,

[R] R suitability for development project

2012-09-02 Thread Eric Langley
Hello All, Eric Langley here with my first post to this list. I am looking to determine if R is suitable for a development project I am working on and if so possibly finding someone proficient in R that would be interested in doing the coding. I would like to preface my inquiry that while I am

Re: [R] a newbie seeking for a simple problem

2012-09-02 Thread Daniel Malter
As df2 has only one column and is thus effectively a variable in this case, you don't even need to merge. df1[df1$gene_name%in%df2$gene_name , ] should do. HTH, Daniel wong, honkit (Stephen) wrote Dear Experienced R users, I have a looks-like simple but complicated problem urgently

Re: [R] Coxph not converging with continuous variable

2012-09-02 Thread Keil, Alex
The coxph function in R is not working for me when I use a continuous predictor in the model. Specifically, it fails to converge, even when bumping up the number of max iterations or setting reasonable initial values. The estimated Hazard ratio from the model is incorrect (verified by an AFT

Re: [R] splits with 0s in middle columns

2012-09-02 Thread arun
Hi, It's working for me. Try this: dat1-read.csv(test.csv) dat2-na.omit(dat1)   nrow(dat1) #[1] 635  nrow(dat2) #[1] 627 B-gsub( slope{0,1}\\s\\((.*)\\),\\1,dat2$Composition_percent_part) fun1-function(x){ C-gsub((.*)/(.*),\\1 0 0 \\2, gsub((.*)/(.*)/(.*),\\1 \\2 0 \\3,

Re: [R] Common elements in columns

2012-09-02 Thread arun
Hi, May be this might help: set.seed(1) df1-data.frame(C1=sample(LETTERS[1:25],20,replace=FALSE),value=sample(50,20,replace=FALSE)) set.seed(15) df2-data.frame(C1=sample(LETTERS[1:25],15,replace=FALSE),C2=1:15) set.seed(3) df3-data.frame(C1=sample(LETTERS[1:10],10,replace=FALSE),B1=rnorm(10,3))