Re: [R] help on ks.test and shapiro.test

2005-11-18 Thread Uwe Ligges
Wen Zhang wrote: I have three files of data which are available at http://zhangw.com/ R/, varied at the number of data. I tried to use R to analyze using shapiro.test, ks.test, and t.test. t.test ran as expected, however, when I run shapiro.test and ks.test commands, error message always

Re: [R] unprecise question on read.table() and the nortest package; was: (no subject)

2005-11-18 Thread Uwe Ligges
Wendy Peng wrote: Hi there, I am trying to perform different normality tests in R. I have no problem when I use Shapiro.test( ). However, when I try to use any normality tests from the Nortest package, I kept getting this error Error in read.table(source, header = T, fill = T) :

Re: [R] dev.copy legend problem

2005-11-18 Thread Florence Combes
Thanks for the answer. The problem we are facing is that we dev.copy to a pdf device and then, the legend doesn't look the same: numbers overlap a little lines. I suspect that this is what you are experiencing. yes it seems to be If you want to end up with a PDF plot, use pdf() and

Re: [R] changing figure size in Sweave

2005-11-18 Thread Bjørn-Helge Mevik
TEMPL Matthias wrote: Use \setkeys{Gin} to modify figure sizes or use explicit \includegraphics commands in combination with Sweave option include=FALSE. Or use \documentclass[nogin,...]{...}. Then the 'Gin' will have no effect, and the size of the plots in the document will not be changed

Re: [R] Fitting model with varying number of predictors

2005-11-18 Thread Prof Brian Ripley
On Fri, 18 Nov 2005, Juni Joshi wrote: I need to fit a number of models with different number of predictors in each model. Say for example, I have three predictors: x1, x2, x3 and I want to fit three models: lm(y~x1+x2) lm(y~x2+x3) lm(y~x1+x2+x3) Instead of typing

Re: [R] Point pattern to grid

2005-11-18 Thread Roger Bivand
On Thu, 17 Nov 2005, Leaf Sun wrote: Dear all, I'd like to change a point pattern to a grid of cells and use one of the variables as the output. e.g. The point pattern is of a window of (500*500) and several features such as pH, SoilType etc. I like to divide it into a grid with cell

Re: [R] Fitting model with varying number of predictors

2005-11-18 Thread Yves Magliulo
try : my_formula = as.formula(paste(y~,xxx)) lm(my_formula) note that you can play with substr in paste to change your formula paste(y~,substr(xxx,1,5)) [1] y~ x1+x2 paste(y~,substr(xxx,4,8)) [1] y~ x2+x3 furthermore, with 10 predictors x1 x2 ...x10 for instence, you can create 2 array of

Re: [R] dev.copy legend problem

2005-11-18 Thread Florence Combes
On 11/17/05, Prof Brian Ripley [EMAIL PROTECTED] wrote: That's why we recommend that you do not use dev.copy but replot on the target device. as I plot the graph in the postscript device, and then want to save it into both pdf and png files, I prefer using dev.copy because it allows me to

Re: [R] Morans I for Spatial Surveillance

2005-11-18 Thread Roger Bivand
On Thu, 17 Nov 2005, Serryn Eagleson wrote: Hello, I am interested in using Morans I for different time intervals to detect disease clusters. Ultimately I would like to use CUSUM - or similar monitoring statistic to monitor the results of Morans I - similar to the work by Rogerson

[R] Compiled name to object

2005-11-18 Thread Claus Atzenbeck
Hi, I have a tricky problem with composing a name that should represent an object: I want to pass a data frame and a string that contains a column name to a function, e.g.: check(testFrame, seconds) The function should now divide the testFrame into two subsets and call a t-test on the

[R] repeated %in%

2005-11-18 Thread Robin Hankin
Hi I have a list of vectors, each one of which should be a subset of the previous one. How do I check that this property actually holds? Toy problem follows with a list of length 4 but my list can be any length subsets - list( l1 = 1:10 , l2 =

Re: [R] Compiled name to object

2005-11-18 Thread Claus Atzenbeck
On Fri, 18 Nov 2005, Claus Atzenbeck wrote: How can I get R to change earlySessions$column to whatever was passed as string, in the above example earlySessions$seconds? In the meanwhile I received a solution: earlySessions[[column]] Claus __

Re: [R] Compiled name to object

2005-11-18 Thread Christoph Buser
Dear Claus You can write earlySessions[,seconds] instead of earlySessions$seconds and with that syntax you can also use: col1 - seconds earlySessions[,col1] and you will get what you are looking for. Best regards, Christoph Buser

Re: [R] repeated %in%

2005-11-18 Thread Peter Dalgaard
Robin Hankin [EMAIL PROTECTED] writes: Hi I have a list of vectors, each one of which should be a subset of the previous one. How do I check that this property actually holds? Toy problem follows with a list of length 4 but my list can be any length subsets - list(

Re: [R] repeated %in%

2005-11-18 Thread Barry Rowlingson
Robin Hankin wrote: check.for.inclusion - function(subsets){ out - rep(FALSE,length(subsets)-1) for(i in 1:(length(subsets)-1)){ out[i] - all(subsets[[i+1]] %in% subsets[[i]]) } return(all(out)) } how to do it elegantly and/or quickly? My first thought was to

Re: [R] repeated %in%

2005-11-18 Thread Barry Rowlingson
Whoops The code I just posted only tested if all the subsequent elements were subsets of the first, it didn't check all the sequential subsets! Too cold to think straight here today... Baz __ R-help@stat.math.ethz.ch mailing list

Re: [R] Building S4-classes, documents

2005-11-18 Thread TEMPL Matthias
Hi Seth, Thank you very much! (and thanks to Matthias Kohl and Sean Davis) My first problems in building a minimal S4-class package are solved with the help of your hints. Especially making R CMD INSTALL before trying R CMD check was a very good idea! Matthias Hi Matthias, On 17 Nov 2005,

[R] R-News 5/2, Bayesian Model Averaging, a detail

2005-11-18 Thread Pirjetä Antti
The article on BMA (Bayesian model averaging) presents most valuable tools for model selection, but I find one detail confusing in Example 1. In page 4 of RNews 5/2, second paragraph says that the probability of Time variable not being in the model is 0.445. It seems to me that the figure

[R] R-News 5/2, Bayesian Model Averaging, a detail

2005-11-18 Thread Pirjetä Antti
The article on BMA (Bayesian model averaging) presents most valuable tools for model selection, but I find one detail confusing in Example 1. In page 4 of RNews 5/2, second paragraph says that the probability of Time variable not being in the model is 0.445. It seems to me that the figure

Re: [R] nlme questions

2005-11-18 Thread Christian Mora
Spencer; Thanks for your suggestions. I found the problem is in the library nlme. If you define phi1~factor(trt1)+factor(trt2) instead of phi1~trt1+trt2 the augPred function works. A bug? I don't know. Christian Spencer Graves [EMAIL PROTECTED] on 17-11-2005 20:19:32 To:Christian

Re: [R] nlme questions

2005-11-18 Thread Austin, Matt
Warning: non-expert thoughts to follow. When passing an object to a predict method, the method looks at (a copy) of the original information from the dataframe that was used in the fit. Your original data contains information on trt1 and trt2, but factor(trt1) and factor(trt2) cannot be found

Re: [R] nlme questions

2005-11-18 Thread Christian Mora
Yes, I agree. But if you define at the beginning of the code: data$trt1-as.factor(data$trt1) data$trt2-as.factor(data$trt2) being trt1 and trt2 dummy variables with values 0 or 1, and then run the model, for instance: fit_1-nlme(Y~b0/(1+exp((b1-X)/b2)),fixed=b0+b1+b2~trt1+trt2,

Re: [R] changing figure size in Sweave

2005-11-18 Thread Bjørn-Helge Mevik
Bjørn-Helge Mevik wrote: Or use \documentclass[nogin,...]{...}. Then the 'Gin' will have no effect, and the size of the plots in the document will not be changed from the size given as ...,height=??,width=?? (i.e. the size produced by R). A small correction: using the 'nogin' doesn't make

Re: [R] Fitting model with varying number of predictors

2005-11-18 Thread Frank E Harrell Jr
Juni Joshi wrote: I need to fit a number of models with different number of predictors in each model. Say for example, I have three predictors: x1, x2, x3 and I want to fit three models: lm(y~x1+x2) lm(y~x2+x3) lm(y~x1+x2+x3) Stepwise variable selection has so many

Re: [R] Surprise when mapping matrix to image

2005-11-18 Thread strinz
Hello, I wonder if image(t(x)[ncol(x):1, ]) can do the job correct! perhaps this does the job better: image(t(x)[,nrow(x):1]) Björn From: Prof Brian Ripley ripley_at_stats.ox.ac.uk Date: Fri 27 Aug 2004 - 06:43:50 EST On Thu, 26 Aug 2004, Glynn, Earl wrote: Start with: x - c(1:7,1)

[R] Likely cause of error (code=1) in compar.gee/gee

2005-11-18 Thread Bielby, Jon
Hi, I'm attempting a comparative analysis using the function compare.gee, package (ape), which uses phylogeny as a correlation matrix in gee (package gee), in R version 2.2.0 on a Windows XP PC. I'm looking to model the relationship between a continuous explanatory variable and a binary

[R] Method for $

2005-11-18 Thread Ulrike Grömping
Dear R experts, I have defined a class myclass and would like the slots to be extractable not only by @ but also by $. I now try to write a method for $ that simply executes the request [EMAIL PROTECTED], whenever someone calls object$slotname for any object of class myclass. I don't manage to

[R] Image display in R

2005-11-18 Thread Vasundhara Akkineni
Hi all, I am trying to display a matrix of plots(images), for example a 3*3 matrix of 9 image plots, such that when a user clicks on a image i can show the enlarged plot. I tried the multiple graphic device(using mfcol=c(3,3) and mfg), but it creates multiple plots in a single image file. So, i

[R] about eval and eval.parent

2005-11-18 Thread ronggui
x-1 f-function(){ x-3 eval(substitute(x+y,list(y=10))) } f() #13 x-1 f-function(){ x-3 eval(substitute(x+y,list(y=10)), envir = sys.frame(sys.parent())) } f() #11 x-1 f-function(){ x-3 eval.parent(substitute(x+y,list(y=10))) } f()#11 the help page says: If 'envir' is not specified,

Re: [R] about eval and eval.parent

2005-11-18 Thread Thomas Lumley
On Fri, 18 Nov 2005, ronggui wrote: x-1 f-function(){ x-3 eval(substitute(x+y,list(y=10))) } f() #13 x-1 f-function(){ x-3 eval(substitute(x+y,list(y=10)), envir = sys.frame(sys.parent())) } f() #11 x-1 f-function(){ x-3 eval.parent(substitute(x+y,list(y=10))) } f()#11 the

[R] How to run R in batch mode

2005-11-18 Thread Beatriz
Hello to everybody! I want to run R in batch mode but it doen't work (Error: syntax error) I've found this in R help: R CMD BATCH [options] infile [outfile] I have tried differents commands: (I have been working in the same directory I have test.txt file and test2.txt would be the output file)

Re: [R] How to run R in batch mode

2005-11-18 Thread Paul Roebuck
On Fri, 18 Nov 2005, Beatriz wrote: I want to run R in batch mode but it doen't work (Error: syntax error) I've found this in R help: R CMD BATCH [options] infile [outfile] I have tried differents commands: (I have been working in the same directory I have test.txt file and test2.txt

Re: [R] Image display in R

2005-11-18 Thread tom wright
This peice of very useful getcell() function was posted for me on this list by Duncan Murdoch (Thanks again Duncan). It allows the identification of a particular plot in a matrix of plots. All you need to do then is use this information to identify the original plot which you can then re-plot.

Re: [R] How to run R in batch mode

2005-11-18 Thread Duncan Murdoch
On 11/18/2005 10:20 AM, Beatriz wrote: Hello to everybody! I want to run R in batch mode but it doen't work (Error: syntax error) I've found this in R help: R CMD BATCH [options] infile [outfile] I have tried differents commands: (I have been working in the same directory I have

Re: [R] about eval and eval.parent

2005-11-18 Thread Prof Brian Ripley
On Fri, 18 Nov 2005, ronggui wrote: x-1 f-function(){ x-3 eval(substitute(x+y,list(y=10))) } f() #13 x-1 f-function(){ x-3 eval(substitute(x+y,list(y=10)), envir = sys.frame(sys.parent())) } f() #11 x-1 f-function(){ x-3 eval.parent(substitute(x+y,list(y=10))) } f()#11 the

Re: [R] How to run R in batch mode

2005-11-18 Thread Beatriz
I've only wirtten library(limma) in my test.txt file and I've tried with test.R and test.r too I' don't know the problem Thank you Paul Roebuck wrote: On Fri, 18 Nov 2005, Beatriz wrote: I want to run R in batch mode but it doen't work (Error: syntax error) I've found this in R help: R

[R] Problems with tkentry

2005-11-18 Thread Marcelo Damasceno
Hello to all, I don't know almost nothing about Tcl/TK. I have the follow code: Name - tclVar() insert.Name -tkentry(window1,width=20,objectvariable=Name) tkplace(tklabel(window1,text= Enter the matrix name:),x=0,y=0) tkplace(insert.Name,x=175,y=0) So, I need to pass the variable Name like

Re: [R] How to run R in batch mode

2005-11-18 Thread Paul Roebuck
On Fri, 18 Nov 2005, Beatriz wrote: Paul Roebuck wrote: On Fri, 18 Nov 2005, Beatriz wrote: I want to run R in batch mode but it doen't work (Error: syntax error) [SNIP] I don't know what is wrong. Could you help me, please? Isn't it possible that it is working just fine and you

[R] Calculation of the median in survfit()

2005-11-18 Thread Christoph Scherber
Dear R users, Can anyone tell me how the medians in survfit() are computed? I´ve looked it up in the source code (print.survfit.s version 4.19 07/09/00), but I´m not a programmer...;-) Especially, I´d like to know what the pfun() function inside print.survfit.s() works. The help file does

Re: [R] Method for $

2005-11-18 Thread Uwe Ligges
Ulrike Grömping wrote: Dear R experts, I have defined a class myclass and would like the slots to be extractable not only by @ but also by $. I now try to write a method for $ that simply executes the request [EMAIL PROTECTED], whenever someone calls object$slotname for any object of

[R] (no subject)

2005-11-18 Thread Anna Pluzhnikov
Hi, I need to run a Fisher's exact test on thousands of 2x2 contingency tables, and repeat this process several thousand times (this is a part of the permutation test for a genome-wide association study). How can I run this process most efficiently? Is there any way to optimize R code? I have

[R] truncated observations in survreg

2005-11-18 Thread Per Jensen
Dear R-list I have been trying to make survreg fit a normal regression model with left truncated data, but unfortunately I am not able to figure out how to do it. The following survreg-call seems to work just fine when the observations are right censored: library(survival) n-10 #censored

Re: [R] How to run R in batch mode

2005-11-18 Thread Duncan Murdoch
On 11/18/2005 11:25 AM, Beatriz wrote: I write R CMD BATCH test.R in my R console I have send you an image (RunBatch.jpg) of my console and the test.R file I don't think the jpg made it to R-help, but I saw it. You tried to run R CMD BATCH test.R from within R. That's meant to be a

Re: [R] Millions of calls to fisher.test (was (no subject))

2005-11-18 Thread Prof Brian Ripley
Setting conf.int=FALSE will help. Looking at the code of fisher.test and extracting just the bit you need will help more. Do you actually need a two-sided test? Fisher did not, and if not, the computations can be reduced to a call to phyper which is vectorized. On Fri, 18 Nov 2005, Anna

Re: [R] Method for $

2005-11-18 Thread Martin Maechler
Ulrike == Ulrike Grömping [EMAIL PROTECTED] on Fri, 18 Nov 2005 15:37:58 +0100 writes: Ulrike Dear R experts, Ulrike I have defined a class myclass and would like the Ulrike slots to be extractable not only by @ but also by $. hmm, I know this is not what you've asked for, but

Re: [R] (no subject)

2005-11-18 Thread Peter Dalgaard
Anna Pluzhnikov [EMAIL PROTECTED] writes: Hi, I need to run a Fisher's exact test on thousands of 2x2 contingency tables, and repeat this process several thousand times (this is a part of the permutation test for a genome-wide association study). How can I run this process most

Re: [R] Method for $

2005-11-18 Thread Ulrike Grömping
Uwe, thank thank you very much for your suggestion. This does in fact work, if I define $.myclass-function(x,slotname){slot(x,slotname)} which solves my immediate need. However, the setMethod version setMethod($, signature(x=myclass), function(x,slotname){ slot(x,slotname) } ) still

Re: [R] Method for $

2005-11-18 Thread Berton Gunter
I believe that a recommended S4 convention is simply to write methods for slot extraction with the same name as the slot. Thus, for an object,x of class 'myclass' slotname(x) would give [EMAIL PROTECTED] This is a more natural interface than either @ or $ (and I am not sure that methods for $

Re: [R] Method for $

2005-11-18 Thread Ulrike Grömping
I have had that thought myself as well, but don't see any harm in my particular application. I describe in general terms what I'm trying to do: I have defined a class for the output of a function that does various calculations. The reason for this is that I want methods for plotting and

Re: [R] Goodness fit test HELP!

2005-11-18 Thread Elizabeth Lawson
What about trying a qqplot to see how the distribution fits... For the normal distribution thta is very stright forward, use qqnorm. To test gamma distribtution (or any other) do some thing like this n-length(data) for(i in 1:n){ prob-(i-1/3)/(n1/3) }

Re: [R] Method for $

2005-11-18 Thread Duncan Temple Lang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ulrike Grömping wrote: Uwe, thank thank you very much for your suggestion. This does in fact work, if I define $.myclass-function(x,slotname){slot(x,slotname)} which solves my immediate need. However, the setMethod version

[R] SWeave - can I see output in the source?

2005-11-18 Thread Duncan Murdoch
I'm working on a Latex document with lots of R code in it, so naturally enough it would be a good idea to use SWeave. But then I don't get to see the output as I'm editing. Or do I? Is there a tool to process a .Rnw file and incorporate the output from the commands into it (in a form that is

Re: [R] Method for $

2005-11-18 Thread Ulrike Grömping
-- Original Message --- From: Duncan Temple Lang [EMAIL PROTECTED] To: Ulrike Grömping [EMAIL PROTECTED] Cc: Uwe Ligges [EMAIL PROTECTED], r-help@stat.math.ethz.ch Sent: Fri, 18 Nov 2005 10:26:51 -0800 Subject: Re: [R] Method for $ -BEGIN PGP SIGNED MESSAGE- Hash:

Re: [R] Method for $

2005-11-18 Thread Ulrike Grömping
Berton, thanks for your code, it does work on my problem. However, I do want the $ do work the extraction, and it does if I do it right (see answer from Duncan Temple Lang). Regards, Ulrike -- Original Message --- From: Berton Gunter [EMAIL PROTECTED] To: 'Uwe Ligges' [EMAIL

[R] truncated regression in survreg

2005-11-18 Thread Per Jensen
Sorry, trying to change the unicode. Dear R-list I have been trying to make survreg fit a normal regression model with left truncated data, but unfortunately I am not able to figure out how to do it. The following survreg-call seems to work just fine when the observations are right censored:

[R] Adding points to wireframe

2005-11-18 Thread Pierre-Luc Brunelle
Hi, I am using function wireframe from package lattice to draw a 3D surface. I would like to add a few points on the surface. I read in a post from Deepayan Sarkar that To do this in a wireframe plot you would probably use the panel function panel.3dscatter. Does someone have an example? When

[R] How to plot two dataset in one fig?

2005-11-18 Thread Wei Qiu
Hi all, I am new in R tool. I would like to plot two dataset in in fig. Here is what I did for both a and b data sets jpeg(file=a.jpeg) dat-read.table('a', header=F, sep=',') dim(dat) y-dat[,1] y-y[!is.na(y)] plot(y);lines(lowess(y, f=0.05), col = (red), lwd=5) dev.off Two questions: 1. How

Re: [R] Point pattern to grid

2005-11-18 Thread Leaf Sun
Hi Roger, Thanks again for your kind help. Yes, I still use the 200K points data applying this program but the good thing is I found it finished in no time. The questions again here are: 1) try0 - lapply(split(as(df1, data.frame), res), mean) When I tried to replace mean to sum, error

Re: [R] Histogram over a Large Data Set (DB): How?

2005-11-18 Thread Eric Eide
Sean == Sean Davis [EMAIL PROTECTED] writes: Sean Have you tried just grabbing the whole column using dbGetQuery? Sean Try doing this: Sean Sean spams - dbGetQuery(con,select unixtime from email limit Sean 100) Sean Sean Then increase

Re: [R] How to plot two dataset in one fig?

2005-11-18 Thread Francisco J. Zagmutt
If I understand your question, to superimpose two lines in a same plot, in the first call to plot() you want to set the plot(ylim) argument with a range that will fit both of your lines. Then use lines() to add the second lowess line on the plot. Or matplot() will automate the process for

Re: [R] Point pattern to grid

2005-11-18 Thread Roger Bivand
On Fri, 18 Nov 2005, Leaf Sun wrote: Hi Roger, Thanks again for your kind help. Yes, I still use the 200K points data applying this program but the good thing is I found it finished in no time. The reply is on R-sig-geo. The questions again here are: 1) try0 -

Re: [R] Histogram over a Large Data Set (DB): How?

2005-11-18 Thread Tim Churches
Eric Eide wrote: Sean == Sean Davis [EMAIL PROTECTED] writes: Sean Have you tried just grabbing the whole column using dbGetQuery? Sean Try doing this: Sean Sean spams - dbGetQuery(con,select unixtime from email limit Sean 100) Sean Sean

[R] Batchjob creates small object but large workspace ???

2005-11-18 Thread Izmirlian, Grant \(NIH/NCI\)
I ran into an interesting problem that I think I have solved. I ran a batch job as --no-save, electing only to save all objects there before the job started and one reasonably small object created as the result of the job, ( ~ 19K ). During the course of the job several large objects are

[R] [package concord] seeking maintainer

2005-11-18 Thread Patrick Drechsler
Hi, can anybody tell me how to contact the maintainer of the concord package? The address given in the help file is not valid anymore. , | help(package=concord) | | Information für Paket 'concord' | | Description: | | Package: concord | Version: 1.4-2 | Date:

Re: [R] [package concord] seeking maintainer

2005-11-18 Thread Marc Schwartz
On Sat, 2005-11-19 at 00:37 +, Patrick Drechsler wrote: Hi, can anybody tell me how to contact the maintainer of the concord package? The address given in the help file is not valid anymore. , | help(package=concord) | | Information für Paket 'concord' | |

Re: [R] [package concord] seeking maintainer

2005-11-18 Thread Patrick Drechsler
Marc Schwartz wrote on 19 Nov 2005 02:07:09 MET: On Sat, 2005-11-19 at 00:37 +, Patrick Drechsler wrote: can anybody tell me how to contact the maintainer of the concord package? The address given in the help file is not valid anymore. [...] A quick search of this month's r-help