Re: [R] no doubt a dumb question, but..

2004-11-09 Thread Martin Maechler
Marc == Marc Schwartz [EMAIL PROTECTED] on Mon, 08 Nov 2004 22:27:47 -0600 writes: Marc On Mon, 2004-11-08 at 21:56, Dr. John R. Vokey wrote: Yes, I am a newbie at R, but it is not the complex commands in R that have me baffled, but simple data commands. For example, why

[R] do.call invoking a function with multiple arguments

2004-11-09 Thread Eric Lecoutre
Hi users, I am not sure to understand the help page about do.call. -- do.call(what, args) args: a _list_ of arguments to the function call. The 'names' attribute of 'args' gives the argument names. -- If we take the following sample data: (tab=as.data.frame(table(factor(1:10

Re: [R] do.call invoking a function with multiple arguments

2004-11-09 Thread Prof Brian Ripley
On Tue, 9 Nov 2004, Eric Lecoutre wrote: I am not sure to understand the help page about do.call. I think you do, just not how to construct a list. -- do.call(what, args) args: a _list_ of arguments to the function call. The 'names' attribute of 'args' gives the argument

Re: [R] do.call invoking a function with multiple arguments

2004-11-09 Thread Dimitris Rizopoulos
Hi Eric, you could try it this way: tab - as.data.frame(table(factor(1:10))) do.call(paste, c(tab, list(sep=:))) [1] 1:1 2:1 3:1 4:1 5:1 6:1 7:1 8:1 9:1 10:1 since `tab' is already a list Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health

[R] Strange results for Beta Distribution

2004-11-09 Thread parrinel
Dear All, I got these results from the example in the function dbeta: x - seq(0, 1, length=21) dbeta(x, 1, 1) [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Any Idea? TIA Giovanni dr. Giovanni Parrinello Section of Medical Statistics Department of Biosciences University of Brescia 25127

Re: [R] neater way to create data frame?

2004-11-09 Thread Petr Pikal
Hi Louize On 8 Nov 2004 at 22:58, Louize Hill wrote: Hello, I have a large data frame and am aiming to create a summary data frame in order to plot quarterly means by age. However, it seems as though I am taking a very long winded approach to this - can anybody point me in the direction

Re: [R] small world models?

2004-11-09 Thread asemeria
__ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

[R] may lao's invitation

2004-11-09 Thread may lao
A Friendly Invitation Hey [EMAIL PROTECTED], may lao has invited you to sign up, so that you can send free SMS (text messages) to each other's mobile phones. Click here to accept your invitation now. http://www.sms.ac/registration/Intro.aspx?InviteId=i2y5y1v08l00n18tse2f

Re: [R] Strange results for Beta Distribution

2004-11-09 Thread Dimitris Rizopoulos
Why strange? It is known that Beta(1, 1) = Uniform(0,1) whose density is 1/(1-0)=1 Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/16/396887 Fax: +32/16/337015

Re: [R] Strange results for Beta Distribution

2004-11-09 Thread Prof Brian Ripley
On Tue, 9 Nov 2004 [EMAIL PROTECTED] wrote: I got these results from the example in the function dbeta: x - seq(0, 1, length=21) dbeta(x, 1, 1) [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Any Idea? What does help page say the density is? A Beta(1,1) distribution is U(0, 1), and

RE: [R] Strange results for Beta Distribution

2004-11-09 Thread Ted Harding
On 09-Nov-04 [EMAIL PROTECTED] wrote: Dear All, I got these results from the example in the function dbeta: x - seq(0, 1, length=21) dbeta(x, 1, 1) [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Any Idea? The density function for Beta(p,q) is (x^(p-1))*((1-x)^(q-1))/B(p,q). In your

[R] Package Documentation, cryptic

2004-11-09 Thread Christian Hoffmann
Hi, sorry for this lengthy post. I am using R-2.0.0 on Unix, compiled. Overview: A) R CMD check: Unaccounted top-level text B) In which sections of *.Rd is LaTeX notation allowed, where *not*? C) Codoc mismatches and polyvalent parameters D) Successful R CMD INSTALL and R CMD build E) cp

[R] gdist and gower distance

2004-11-09 Thread Alessio Boattini
Dear All, I would like to ask clarifications on the gower distnce matrix calculated by the function gdistin the library mvpart. Here is a dummy example: library(mvpart) Loading required package: survival Loading required package: splines mvpart package loaded: extends rpart to include

[R] Some questions to GLMM

2004-11-09 Thread Jan Hattendorf
Hello all R-user I am relative new to the R-environment and also to GLMM, so please don't be irritated if some questions don't make sense. I am using R 2.0.0 on Windows 2000. I investigated the occurrence of insects (count) in different parts of different plants (plantid) and recorded as well

[R] R code debugging

2004-11-09 Thread Timur Elzhov
Dear useRs, it's quite difficult for me to find `Error:'s in my R code, because R does say about error itself, but say nothing about its location, say, string number and file with an error (which may be `source'd from another file). Are there any option for turning of the similar feature, or R

[R] email result as attachement

2004-11-09 Thread Ramzi TEMANNI
Hi, I’d like to know if it's possible to mail a file (image generated with R) in attachments a similar to bug.report Thanks in advance. TEMANNI Ramzi PhD Student LimBio http://www.limbio-paris13.org UFR de Santé, Médecine et Biologie Humaine (SMBH) Léonard de Vinci 74, rue Marcel Cachin 93017

[R] R under Pocket PC

2004-11-09 Thread Lars Strand
Will R run under Windows Pocket PC? Yours Lars Strand [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide!

Re: [R] R code debugging

2004-11-09 Thread Sean Davis
You are probably interested in traceback(). See ?traceback. Also, the debugger is your friend. See ?debug. Sean On Nov 9, 2004, at 6:52 AM, Timur Elzhov wrote: Dear useRs, it's quite difficult for me to find `Error:'s in my R code, because R does say about error itself, but say nothing about

[R] Beta distribution Example

2004-11-09 Thread parrinel
Sorry , I had to think a little bit more about.. But I think that the example is strange. generally an example ir related to a quite general condition, not to a special case.. Thanks dr. Giovanni Parrinello Section of Medical Statistics Department of Biosciences University of Brescia 25127

Re: [R] R code debugging

2004-11-09 Thread Ernesto Jardim
Hi, Check R's manual R Language Definition. Regards EJ On Tue, 2004-11-09 at 11:52, Timur Elzhov wrote: Dear useRs, it's quite difficult for me to find `Error:'s in my R code, because R does say about error itself, but say nothing about its location, say, string number and file with an

Re: [R] R code debugging

2004-11-09 Thread Prof Brian Ripley
On Tue, 9 Nov 2004, Timur Elzhov wrote: it's quite difficult for me to find `Error:'s in my R code, because R does say about error itself, but say nothing about its location, say, string number and file with an error (which may be `source'd from another file). Are there any option for turning

Re: [R] R under Pocket PC

2004-11-09 Thread Prof Brian Ripley
On Tue, 9 Nov 2004, Lars Strand wrote: Will R run under Windows Pocket PC? We don't know! There are no binary versions of R for that platform, but perhaps you could find a suitable compiler and manage to build the sources. Outside pure mathematics it is usually very hard to establish that

[R] PCA prcomp problem

2004-11-09 Thread Deirdre Toher
I've just starting using the prcomp function, and I want to be able to extract individual principal components (e.g. PC1, PC2) in vector format. I haven't been able to find any documentation that explains how to do this (or even if it is possible). Any help on the subject would be greatly

RE: [R] no doubt a dumb question, but..

2004-11-09 Thread Doran, Harold
It would work if you modified as follows: plot(lm(Girth~Height)) Or alternatively, fm1-lm(Girth~Height);plot(fm1) Harold -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dr. John R. Vokey Sent: Monday, November 08, 2004 10:56 PM To: [EMAIL PROTECTED]

[R] glm.nb stop on Error.

2004-11-09 Thread Ronaldo Reis Jr.
Hi, I make an analysis sequence on R. In some cases the function glm.nb fail to ajust the model. Its Ok. The problem is that this error stop the program. I need treat this error and not stop the program. Something like this: ... model - glm.nb(y~x,maxit=1000) if(glm.nb fail) { teste[i] - 0 }

Re: [R] PCA prcomp problem

2004-11-09 Thread Prof Brian Ripley
On Tue, 9 Nov 2004, Deirdre Toher wrote: I've just starting using the prcomp function, and I want to be able to extract individual principal components (e.g. PC1, PC2) in vector format. I haven't been able to find any documentation that explains how to do this (or even if it is possible).

Re: [R] Converting strings to date

2004-11-09 Thread Roger D. Peng
You need to be more specific when you say it works =) strptime() returns a POSIXlt object whose printed representation appears to be a string (but it is a list). What you want, I think, is either as.POSIXct() or as.Date(). See ?DateTimeClasses. -roger João Mendes Moreira wrote: Hello, I

Re: [R] gdist and gower distance

2004-11-09 Thread Jari Oksanen
On Tue, 2004-11-09 at 12:59, Alessio Boattini wrote: Dear All, I would like to ask clarifications on the gower distnce matrix calculated by the function gdistin the library mvpart. Here is a dummy example: library(mvpart) Loading required package: survival Loading required package:

[R] Multiple stripcharts using for loop

2004-11-09 Thread Paul JH Drake
Hi I'm able to create multiple plots from a dataset using a for loop to change variables, but when I try with stripchart it doesn't work. Standard boxplot: for(i in 2:14){boxplot(klk[,i]~Group,main=colnames(klk)[i]) Stripchart: for(i in 2:14){stripchart(klk[,i]~Group,main=colnames(klk)[i])

Re: [R] Extension provokes crash in unzReadCurrentFile

2004-11-09 Thread Mark White
On Mon, 8 Nov 2004, Mark White wrote: Any idea what might be causing a compressed file read? Prof Brian Ripley writes: It's not a compressed file read, but rather from the interface for unz() connections to zip files. That is very unlikely to be used on a non-Windows system, so if

Re: [R] no doubt a dumb question, but..

2004-11-09 Thread Marc Schwartz
On Tue, 2004-11-09 at 02:07, Martin Maechler wrote: SNIP Further note that many of us try to avoid attach()ing data frames (most of the time; not always) and we have provided the nice alternative with( data , expression_body ) So, for the current example, you could also say

RE: [R] survSplit: further exploration and related topics

2004-11-09 Thread BXC (Bendix Carstensen)
To Danardonos concern of splitting time for records with delayed entry: This can fairly easily be accomodated, by simply splitting time in small intervals of time since entry into the study, and then compute the value of the other timescales for each of these e.g.: current.age - time.from.entry

[R] Error in update() when repositories is specified.

2004-11-09 Thread Andy Bunn
How can I specify the repositories for upgrade()? x - packageStatus(repositories = http://cran.us.r-project.org//bin/windows/contrib/2.0;) upgrade(x, ask = FALSE) Error in update[, 3] : incorrect number of dimensions x, the object of class packageStatus, prints and summarizes fine. I also ran

RE: [R] survSplit: further exploration and related topics

2004-11-09 Thread Thomas Lumley
On Tue, 9 Nov 2004, BXC (Bendix Carstensen) wrote: To Danardonos concern of splitting time for records with delayed entry: There was actually no intention of supporting counting-process input, but it turns out to be a one-line change: from starttime - c(starttime, rep(cut, each = n)) to

Re: [R] Some questions to GLMM

2004-11-09 Thread Douglas Bates
Jan Hattendorf wrote: Hello all R-user I am relative new to the R-environment and also to GLMM, so please don't be irritated if some questions don't make sense. I am using R 2.0.0 on Windows 2000. I investigated the occurrence of insects (count) in different parts of different plants (plantid)

RE: [R] Error in update() when repositories is specified.

2004-11-09 Thread Andy Bunn
Ooops. Make that subject line 'upgrade', not 'update!' Sorry. -AB -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Andy Bunn Sent: Tuesday, November 09, 2004 9:23 AM To: R-Help Subject: [R] Error in update() when repositories is specified. How can I

Re: [R] Conditional selection of rows

2004-11-09 Thread Thomas Lumley
On Tue, 9 Nov 2004, F Z wrote: Hi, I have a data.frame with several variables and 50,000 observations. i.e. data[1:2,1:7] Iteration Day Production.Type tsUSusc tsASusc tsULat tsALat 1 0 Generic 17965 8833053 0 0 1 1 Generic 17965 8833053 0

Re: [R] R under Pocket PC

2004-11-09 Thread Peter Dalgaard
Prof Brian Ripley [EMAIL PROTECTED] writes: On Tue, 9 Nov 2004, Lars Strand wrote: Will R run under Windows Pocket PC? We don't know! There are no binary versions of R for that platform, but perhaps you could find a suitable compiler and manage to build the sources. The PDA idea is

[R] list - environment coercion

2004-11-09 Thread Valery A.Khamenya
Hi all, there is environment-list coercion, i.e. as.list.environment. Is there any list-environment coercion? thank you. -- Valery. __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide!

Re: [R] R under Pocket PC

2004-11-09 Thread Tim Cutts
On 9 Nov 2004, at 12:27 pm, Prof Brian Ripley wrote: On Tue, 9 Nov 2004, Lars Strand wrote: Will R run under Windows Pocket PC? We don't know! There are no binary versions of R for that platform, but perhaps you could find a suitable compiler and manage to build the sources. Outside pure

Re: R: [R] glm.nb stop on Error.

2004-11-09 Thread Ronaldo Reis Jr.
Em Tuesday 09 November 2004 12:12, Vito Muggeo escreveu: if(class(model)==try-error) Thanks it works fine :) Ronaldo -- O importante não é ganhar. O que importa é competir sem perder nem empatar. -- | // | \\ [***] | ( õ õ ) [Ronaldo Reis Júnior

[R] increase memory size on Unix

2004-11-09 Thread Hua Li
Is there any way I can increase memory size for R under Unix? I tried Memory function, which was not working. Thanks, Hua Li __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide!

[R] frailty model for gap times

2004-11-09 Thread Lei Liu
Hi there, I have a question on the frailty model for gap times with distinct baseline hazard for each gap. Can I use R coxph function to do it? For example, the following code assumes an identical baseline hazard for every gap time, but what if I want a distinct baseline hazard for each gap?

Re: [R] list - environment coercion

2004-11-09 Thread Dimitris Rizopoulos
Hi Valery, a simple way to do it might be the following: lis - list(a=10, b=20, d=x) e1 - new.env() for(i in 1:length(lis)) assign(names(lis)[i], lis[[i]], envir=e1) d get(d, env=e1) I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public

Re: [R] R under Pocket PC

2004-11-09 Thread Prof Brian Ripley
On Tue, 9 Nov 2004, Tim Cutts wrote: On 9 Nov 2004, at 12:27 pm, Prof Brian Ripley wrote: On Tue, 9 Nov 2004, Lars Strand wrote: Will R run under Windows Pocket PC? We don't know! There are no binary versions of R for that platform, but perhaps you could find a suitable

Re: [R] R under Pocket PC

2004-11-09 Thread David Whiting
Peter Dalgaard [EMAIL PROTECTED] writes: Prof Brian Ripley [EMAIL PROTECTED] writes: On Tue, 9 Nov 2004, Lars Strand wrote: Will R run under Windows Pocket PC? We don't know! There are no binary versions of R for that platform, but perhaps you could find a suitable

Re: [R] increase memory size on Unix

2004-11-09 Thread Thomas Lumley
On Tue, 9 Nov 2004, Hua Li wrote: Is there any way I can increase memory size for R under Unix? I tried Memory function, which was not working. Possibly because there is no Memory function. The standard configuration of R under Unix uses all the memory the operating system will give it. If

RE: [R] Error in update() when repositories is specified.

2004-11-09 Thread Prof Brian Ripley
I don't think that has ever been tested under Windows: until recently packageStatus did not work under Windows at all. The problem seems to be in ask=FALSE, which looks completely broken. ask=TRUE seems to work. This was true of Unix, 1.9.1 as well so I guess no one ever uses it On Tue, 9

Re: [R] no doubt a dumb question, but..

2004-11-09 Thread John
On Monday 08 November 2004 19:56, Dr. John R. Vokey wrote: Yes, I am a newbie at R, but it is not the complex commands in R that have me baffled, but simple data commands. For example, why does something like: plot(Girth ~ Height) *not* work after a command that allegedly loads the data:

Re: [R] R under Pocket PC

2004-11-09 Thread Peter Dalgaard
Tim Cutts [EMAIL PROTECTED] writes: Technically, I don't suppose there's much to stop R running on some PDAs, especially those based on Linux like the Sharp Zaurus, other than storage and memory requirements. If there's a Qt graphical interface available for R, you could even get graphics

[R] Vector multiplication wrap-around

2004-11-09 Thread Wollenberg, Kurt R
Greetings: In a function I'm trying to write I am multiplying each row in a matrix by a vector. When the vector extends beyond the end of the matrix I need to have the multiplication wrap around (continue with column 1 of the matrix). Initially I got this to work with a loop (old programming

Re: [R] R under Pocket PC

2004-11-09 Thread Peter Dalgaard
Prof Brian Ripley [EMAIL PROTECTED] writes: The Windows API on Pocket PC is quite a reduced subset compared to full Windows, so you might have problems with that. But that was. However, as I said, you would have to find a suitable compiler or cross-compiler, that supports enough

Re: [R] R under Pocket PC

2004-11-09 Thread Gabor Grothendieck
David Whiting david.whiting at ncl.ac.uk writes: : It is interesting this has come up at this time. Two days ago I : installed Linux on a Psion 5MX (16Mb RAM) and am tickled pink by : it. Installation is easy. At the moment I only have a small : compactflash disk so I have not been able to

[R] R works on Fedora Core 3

2004-11-09 Thread Jonathan Baron
The RPM for Fedora Core 2 seems to work just fine on Core 3. (The graphics window got smaller, but I'm sure there is a setting for that.) Jon -- Jonathan Baron, Professor of Psychology, University of Pennsylvania Home page: http://www.sas.upenn.edu/~baron R search page:

Re: [R] R works on Fedora Core 3

2004-11-09 Thread Jari Oksanen
On 9 Nov 2004, at 19:44, Jonathan Baron wrote: The RPM for Fedora Core 2 seems to work just fine on Core 3. (The graphics window got smaller, but I'm sure there is a setting for that.) That would be good news. I really don't know how the graphics window became so big at some stage. (MacOS X is

Re: [R] R works on Fedora Core 3

2004-11-09 Thread Jonathan Baron
On 11/09/04 20:37, Jari Oksanen wrote: On 9 Nov 2004, at 19:44, Jonathan Baron wrote: The RPM for Fedora Core 2 seems to work just fine on Core 3. (The graphics window got smaller, but I'm sure there is a setting for that.) That would be good news. I really don't know how the graphics

Re: [R] Conditional selection of rows

2004-11-09 Thread F Z
Many thanks to Gabor Grothendieck, Thomas Lumley and James Holtman for their useful answers on this thread. The three solutions worked for the problem. Here is a sumary of their responses (modified for consistency on notations): F Z gerifalte28 at hotmail.com writes: : Hi, : : I have a

[R] Problems on Bsprob procedure

2004-11-09 Thread Marius A
Shalom. I have some problems in the BsProb procedure. I construct a full orthogonal factorial experimental design of 26 when the response is from random sampling from normal distribution with expectancy that depends on factor A (equal 2 when A=-1 and equal 0.5 when A=1). On primary analysis using

Re: [R] R under Pocket PC

2004-11-09 Thread David Whiting
Gabor Grothendieck [EMAIL PROTECTED] writes: David Whiting david.whiting at ncl.ac.uk writes: : It is interesting this has come up at this time. Two days ago I : installed Linux on a Psion 5MX (16Mb RAM) and am tickled pink by : it. Installation is easy. At the moment I only have a small

[R] gplot.hexbin - how to set figure margin.

2004-11-09 Thread Wolski
Hi, Would like to use to the hexbin package to plot a 2D hist - because it looks really _cool_. My problem is related to drawing a pdf hexbin graphic in series of other graphics. All other figures have a par(mar=c(3.2,3.2,1,1)). So the gplot.hexbin figure in this series looks a little

RE: [R] R code debugging

2004-11-09 Thread Vadim Ogranovich
You might want to check out the debug package on CRAN: debug: MVB's debugger for R Debugger for R functions, with code display, graceful error recovery, line-numbered conditional breakpoints, access to exit code, flow control, and full keyboard input. Version:1.0.1 Depends:R (=

[R] Boxplot plot range

2004-11-09 Thread Scott Rifkin
How can I set the plot range for a boxplot using the boxplot() function? For example, the values in the boxplot go from -3 to 3 (outliers plotted), but I'd like the y axis to go from -5 to 5. Thanks much Scott dot Rifkin at yale dot edu __ [EMAIL

RE: [R] Boxplot plot range

2004-11-09 Thread Liaw, Andy
From: Scott Rifkin How can I set the plot range for a boxplot using the boxplot() function? For example, the values in the boxplot go from -3 to 3 (outliers plotted), but I'd like the y axis to go from -5 to 5. as in: boxplot(rnorm(30), ylim=c(-5, 5)) ? Andy Thanks much Scott

RE: [R] Boxplot plot range

2004-11-09 Thread Andy Bunn
How about using ylim? foo - rnorm(100, 0, 1) boxplot(foo, ylim = c(-5, 5)) HTH, Andy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Scott Rifkin Sent: Tuesday, November 09, 2004 2:43 PM To: [EMAIL PROTECTED] Subject: [R] Boxplot plot range How

[R] Need car() and cdr() for '...'

2004-11-09 Thread Paul Roebuck
Needed to redefine function sum for my MATLAB package. There's something similar in Chambers's Green Book (pg 351) so I modified it as such: library(methods) setGeneric(sum, function(x, ..., na.rm = FALSE) { if (nDotArgs(...) 0) sum(c(sum(x, na.rm = na.rm), sum(...,

[R] Is nesting {} inside \eqn OK?

2004-11-09 Thread Ross Boylan
I'm seeing various things fail when I try to next braces inside \eqn. This source \eqn{{\bf\beta}_j}{b(j)} is the vector produces this error -- [4] ! Missing $ inserted. inserted text $ l.258 \eqn{{\bf\beta}_j}{\bf\beta}_

[R] remove missing values from matrix or data frame

2004-11-09 Thread William Briggs
Is there any way besides looping to remove complete rows from a matrix or data frame where there is at least one NA in any of the columns? For example a [,1] [,2] [1,] 02.6875 [2,] 8.37 6.625 [3,] 15.6 4.375 [4,] 23.4 6.25 [5,] 29 5.09375 [6,] 18

Re: [R] remove missing values from matrix or data frame

2004-11-09 Thread Spencer Graves
How about the following: (A - array(c(1, NA, 3, NA, 4, 5), dim=c(3,2))) [,1] [,2] [1,]1 NA [2,] NA4 [3,]35 A[apply(A, 1, function(x)!any(is.na(x))), , drop=F] [,1] [,2] [1,]35 hope this helps. spencer graves William Briggs wrote: Is there any way

Re: [R] remove missing values from matrix or data frame

2004-11-09 Thread Prof Brian Ripley
Something is not as it seems: a - matrix(scan(),,2,byrow=T) 1: 02.6875 3: 8.37 6.625 5: 15.6 4.375 7: 23.4 6.25 9: 29 5.09375 11: 18 NA 13: 04.15625 15: 9.37 6.25 17: 14.7 5.875 19: 31.26667 6.15625 21: NA 2.357 23: NA

RE: [R] remove missing values from matrix or data frame

2004-11-09 Thread Berton Gunter
?na.omit as in A-na.omit(A) -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA The business of the statistician is to catalyze the scientific learning process. - George E. P. Box -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On

Re: [R] remove missing values from matrix or data frame

2004-11-09 Thread Roger D. Peng
You might be interested in complete.cases(), as in: use - complete.cases(a) a[use, ] -roger William Briggs wrote: Is there any way besides looping to remove complete rows from a matrix or data frame where there is at least one NA in any of the columns? For example a [,1] [,2] [1,]

[R] Data Censoring and Normality Tests

2004-11-09 Thread Kenneth Frost
Hello, I would like to know if there is a function in R that will test for normality and handle censored data sets. Currently, I evaluate each censored data set by the extent to which a normal scores plot approximate a straight line. For complete data sets I use shapiro.test(). Below is an

RE: [R] Data Censoring and Normality Tests

2004-11-09 Thread Liaw, Andy
I don't know much about censored data, but what you described doesn't sound like censored data, but rather truncated data. I think normality tests are over-(ab)used, and would suggest inspection of normal QQ plots instead (as you already do). For formal tests, you might be able to cook up

RE: [R] Data Censoring and Normality Tests

2004-11-09 Thread Liaw, Andy
I stand corrected! Hope Bert doesn't mind me CC'ing the list. Andy From: Berton Gunter No Andy, they're (left) censored alright: their values are known to be below 2.4, but not how far below. Truncated data arise when observations are actually observed only when they take on values in

Re: [R] frailty model for gap times

2004-11-09 Thread Thomas Lumley
On Tue, 9 Nov 2004, Lei Liu wrote: Hi there, I have a question on the frailty model for gap times with distinct baseline hazard for each gap. Can I use R coxph function to do it? For example, the following code assumes an identical baseline hazard for every gap time, but what if I want a

[R] worked in R, but not in S-Plus

2004-11-09 Thread array chip
Hi, I wrote a function that worked well in R, but not in S-Plus, can anyone suggest a solution? f.coxph.zph-function(x) { cox.fit - coxph(Surv(time.cox, status.cox) ~ x, na.action = na.exclude, method = breslow) fit.zph-cox.zph(cox.fit,transform='log') fit.zph$table[,3]

[R] about vsn

2004-11-09 Thread
Hi all: Are thare anyones that use vsn?Some questions need your help.Thanks a lot 1.If e1(raw data) contain 2419 genes, after e2-vsn(e1),e2 contains 2419*2 genes. Why does it happen? 2.How the ¡°calibrated and glog-transformation¡± is perform. In other words, what¡¯s the calculation method

[R] RE: [S] worked in R, but not in S-Plus

2004-11-09 Thread Austin, Matt
The following works, you need to include x=TRUE in the call to coxph. Passing the time and status variables as additional arguments is a matter of personal preference. f.coxph.zph-function(x, timeVar, statusVar) { cox.fit - coxph(Surv(timeVar, statusVar) ~ x, na.action = na.exclude,

[R] List seems to drop empty levels of factors when containing them

2004-11-09 Thread Andrew Robinson
Greetings R community, I am curious about the following behaviour: if I define a factor, and then store a subset of it in a list, the stored version seems to drop levels that were not included in the subset. E.g. .. mask - c(T, F) grp.1 - factor(c(1,2)) list(grp.1) [[1]] [1] 1 2 Levels: 1 2

RE: [R] List seems to drop empty levels of factors when containin g them

2004-11-09 Thread Austin, Matt
I don't get the same result, do you have a package loaded that would change the default behavior (such as Hmisc)? list(grp.1) [[1]] [1] 1 2 Levels: 1 2 list(grp.1[mask]) [[1]] [1] 1 Levels: 1 2 library(Hmisc) snip list(grp.1[mask]) [[1]] [1] 1 Levels: 1 --Matt version _

Re: [R] List seems to drop empty levels of factors when containing them

2004-11-09 Thread Sundar Dorai-Raj
Andrew Robinson wrote: Greetings R community, I am curious about the following behaviour: if I define a factor, and then store a subset of it in a list, the stored version seems to drop levels that were not included in the subset. E.g. .. mask - c(T, F) grp.1 - factor(c(1,2)) list(grp.1) [[1]]

Re: [R] List seems to drop empty levels of factors when containin g them

2004-11-09 Thread Andrew Robinson
Matt, very astute - thanks. I did indeed have Hmisc loaded. Andrew On Tue, Nov 09, 2004 at 08:12:57PM -0800, Austin, Matt wrote: I don't get the same result, do you have a package loaded that would change the default behavior (such as Hmisc)? list(grp.1) [[1]] [1] 1 2 Levels: 1 2

Re: [R] Multiple stripcharts using for loop

2004-11-09 Thread Petr Pikal
Hallo I can not reproduce your result with artificial data (R2.0.0). Error says that some of your data have infinite values somewhere. Try to figure out in which cycle it gives this error and inspect your data from this cycle. I suppose you have all of them missing, but I wonder why boxplot

Re: [R] R under Pocket PC

2004-11-09 Thread A.J. Rossini
One concern I recall from looking into this a while back (hopefully not founded) was the issue with floating point handling on the ARMs and similar PDA CPUs. This was relevant to the familiar/intimate linux distro's around 18-24 months ago, when I was considering an IPAQ or Zaurus to replace my