Re: [R] How to shadow 'power' area?

2007-06-25 Thread Christos Hatzis
Look at the following link: http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=88 This should be pretty close to what you want. HTH -Christos > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Andrej Kastrin > Sent: Monday, June 25, 2007

Re: [R] vectorize a function

2007-06-22 Thread Christos Hatzis
How about: sum(sapply(unique(a), function(x) {b <- which(a==x); sum(M[b, b])})) HTH -Christos Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Tel: 781-938-3830 www.nuverabio.com > -Original Message- > From: [EMAIL

Re: [R] Removing vertical line in Tinn R editor

2007-06-06 Thread Christos Hatzis
Go to Options/Main/Editor Click on EdgeColor and select white as the color (or to whatever color you have set your page's background). This will make the edge line disappear. -Christos > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Judith Flores

Re: [R] pie chart in lattice - trellis class

2007-05-28 Thread Christos Hatzis
t tried it myself). http://www.stat.auckland.ac.nz/~paul/RGraphics/chapter7.html See Figure 7.18 and code -Christos Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Tel: 781-938-3830 www.nuverabio.com > -Original Message- > Fro

Re: [R] names of objects in .rda

2007-05-11 Thread Christos Hatzis
Thanks. -Christos > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Seth Falcon > Sent: Friday, May 11, 2007 1:32 PM > To: r-help@stat.math.ethz.ch > Subject: Re: [R] names of objects in .rda > > "Christos Hatzis" <

Re: [R] names of objects in .rda

2007-05-11 Thread Christos Hatzis
An approach would be to attach it and then use ls() attach(myarchive.rda) ls(pos=2) detach(myarchive.rda) -Christos Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Tel: 781-938-3830 www.nuverabio.com > -Original Message- >

Re: [R] voronoi.mosaic chokes?

2007-05-08 Thread Christos Hatzis
e it bombs. -Christos Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Tel: 781-938-3830 www.nuverabio.com > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Andrew Pierce > Sent: Wednesd

Re: [R] A function for raising a matrix to a power?

2007-05-06 Thread Christos Hatzis
Here is a recursive version of the same function: "%^%" <- function(A, n) if(n == 1) A else A %*% (A %^% (n-1)) > a <- matrix(1:4, 2) > a %^% 1 [,1] [,2] [1,]13 [2,]24 > a %^% 2 [,1] [,2] [1,]7 15 [2,] 10 22 > a %^% 3 [,1] [,2] [1,] 37 81 [2,] 54 1

Re: [R] R package development in windows

2007-05-04 Thread Christos Hatzis
ttach(file.path(my.package.dir, "MyStuff.RData")) This will make your objects available in your current session without cluttering your workspace. Of course, there is a price to pay for simplicity (i.e. no error checks, no documentation etc). -Christos Christos Hatzis, Ph.D. Nuvera Biosci

Re: [R] the Surv function

2007-05-01 Thread Christos Hatzis
behind the function. -Christos Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Tel: 781-938-3830 www.nuverabio.com > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Jennifer Dillon > Sent: Tue

Re: [R] how to code the censor variable for "survfit"

2007-04-28 Thread Christos Hatzis
The Surv object contains the information on the type of censoring. Look at ?Surv for an explanation of how censored events are represented. -Christos > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Lu, Jiang > Sent: Saturday, April 28, 2007 11:

Re: [R] Extract p-value from survdiff function

2007-04-26 Thread Christos Hatzis
If sdf <- survdiff(...) is your survdiff object, the p-value can be computed as follows: p.val <- 1 - pchisq(sdf$chisq, length(sdf$n) - 1) and then use it in your K-M plot. -Christos Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Te

Re: [R] graphs superimposed on pictures?

2007-04-11 Thread Christos Hatzis
Take a look at Figure 3.26 from Paul Murrell's book and associated code posted here: http://www.stat.auckland.ac.nz/~paul/RGraphics/chapter3.html -Christos > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Robert Biddle > Sent: Wednesday, April 1

Re: [R] ISwR library

2007-04-09 Thread Christos Hatzis
Take a look at the "R Installation and Administration" manual - Section 6.1 Installing packages. It is platform-dependent and you didn't say what platform you're on. -Christos > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of slomascolo > Sent: Mo

Re: [R] transition matrices

2007-04-04 Thread Christos Hatzis
ion.htm The link is for a windows application (PermutMatrix) that can perform seriation on distance matrices used in hierarchical clustering, but might be useful in your context as well. -Christos Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 018

Re: [R] Create a new var reflecting the order of subjects in existingvar

2007-04-01 Thread Christos Hatzis
Try this: y <- rle(dat$ID) unlist(sapply(y$lengths, FUN=function(x) seq(1,x))) Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Tel: 781-938-3830 www.nuverabio.com > -Original Message- > From: [EMAIL PROTECTED] > [m

Re: [R] multi-level modeling & R?

2007-03-28 Thread Christos Hatzis
Also, take a look at Andrew Gelman's recent book with Jennifer Hill on multilevel modeling. It is written as a practical how-to text book using R as the primary platform. I have found it very easy to read, extremely useful and very good value for its price (I am not related to the authors or the p

Re: [R] what is the difference between survival analysis and (...)

2007-03-28 Thread Christos Hatzis
in the good prognosis group and thus the two groups will not have a homogeneous censorship structure. In this case, naïve analysis could be misleading. For more details and a simulation example take a look at http://jnci.oxfordjournals.org/cgi/data/99/2/147/DC1/3 HTH -Christos Christos

Re: [R] Replacement in an expression - can't use parse()

2007-03-27 Thread Christos Hatzis
A way to do this is through substitute: e1 <- substitute(expression(u1 + u2 + u3), list(u2=quote(x), u3=1)) But I am not sure whether you will run into similar limitations regarding the length of the expression to be substituted. -Christos Christos Hatzis, Ph.D. Nuvera Biosciences, Inc.

Re: [R] Select the last two rows by id group

2007-03-20 Thread Christos Hatzis
You can try the following: n.len <- nrow(iris) n.sel <- 3 iris[(n.len-n.sel+1):n.len, ] -Christos > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Lauri Nikkinen > Sent: Tuesday, March 20, 2007 10:33 AM > To: r-help@stat.math.ethz.ch > Subject: [

Re: [R] Highlight overlapping area between two curves

2007-03-12 Thread Christos Hatzis
See http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=7 and code therein. -Christos > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Nguyen > Dinh Nguyen > Sent: Tuesday, March 13, 2007 12:20 AM > To: r-help@stat.math.ethz.ch > Subjec

Re: [R] Table Construction from calculations

2007-03-09 Thread Christos Hatzis
Your "data table" basis is actually a dataframe, whose first column is non-numeric. That's what is causing the problem. Try removing the first column of the dataframe before adding the row to your matrix: test <- latpoints + basis[2, -1] -Christos Christos Hatzis, Ph.D.

Re: [R] Duplicate rows of matrix

2007-03-09 Thread Christos Hatzis
Try this: a <- matrix(c(8, 4.2, 9.4, 1.1),2) b <- c(3,1) a[rep(1:nrow(a), b), ] -Christos Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Tel: 781-938-3830 www.nuverabio.com > -Original Message- > From: [EMA

Re: [R] Matrix conversion question

2007-03-09 Thread Christos Hatzis
Try split(x, row(x)) -Christos > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Johannes Graumann > Sent: Friday, March 09, 2007 10:30 AM > To: r-help@stat.math.ethz.ch > Subject: [R] Matrix conversion question > > Hello, > > Please help - I'

Re: [R] understanding print.summary.lm and perhaps print/show in general

2007-03-09 Thread Christos Hatzis
$na.action <- z$na.action class(ans) <- "summary.lm" ^^ ans } So then print.summary.lm does all the job displaying the summary.lm object. To see that function do getAnywhere(print.summary.lm) Then you can then modify that function as needed. -Ch

Re: [R] Memory Limits in Ubuntu Linux

2007-03-06 Thread Christos Hatzis
Take a look at Windows FAQ 2.9. Following the instructions there, I was able to make WinXP use at least 3GB of RAM (physical RAM installed) with Rgui.exe. -Christos Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Tel: 781-938-3830

Re: [R] Help with paste()

2007-03-03 Thread Christos Hatzis
What do you want to do with rbind? paste produces a single vector of 24 character-valued elements. If you want a column vector, you could do that by x <- paste('txt.est',1:24, sep = '') matrix(x, ncol=1) -Christos Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West C

Re: [R] Can a data.frame column contain lists/arrays?

2007-02-12 Thread Christos Hatzis
Why do you need to use a data frame? A list will give you the flexibility you want: d <- list( x=list( c(1,2), c(5,2), c(9,1) ), y=c( 1, -1, -1) ) Then you can access the individual elements > d$x [[1]] [1] 1 2 [[2]] [1] 5 2 [[3]] [1] 9 1 > d$y [1] 1 -1 -1 > d$x[[1]] [1] 1 2 -Christos

Re: [R] blank upper or lower triangle of cor-matrix

2007-02-07 Thread Christos Hatzis
And if you want to know how it is done, take a look at stats:::print.dist -Christos > -Original Message- > From: Christos Hatzis [mailto:[EMAIL PROTECTED] > Sent: Wednesday, February 07, 2007 2:16 PM > To: 'Leo Gürtler'; 'r-help@stat.math.ethz.ch' &

Re: [R] blank upper or lower triangle of cor-matrix

2007-02-07 Thread Christos Hatzis
You can try as.dist(d) Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Tel: 781-938-3830 www.nuverabio.com > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Leo Gürtler > Sen

Re: [R] Adding Histograms to Leaves of Rpart Tree or other Dendrogram

2007-02-02 Thread Christos Hatzis
Hi Jon, Take a look at this graph http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=85 I think it is very close to what you need (source code provided at the site). -Christos Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Tel

Re: [R] Lining up x-y datasets based on values of x

2007-02-01 Thread Christos Hatzis
of x On Thu, 2007-02-01 at 22:46 -0500, Christos Hatzis wrote: > Marc, > > I don't think the issue is duplicates in the matching columns. The > data were generated by an instrument (NMR spectrometer), processed by > the instrument's software through an FFT transform an

Re: [R] Lining up x-y datasets based on values of x

2007-02-01 Thread Christos Hatzis
fill = fill) do.call("merge0", lapply(X, function(x) zoo(x[,2], x[,1]))) To get more info on zoo try: vignette("zoo") On 2/1/07, Christos Hatzis <[EMAIL PROTECTED]> wrote: > Hi, > > I was wondering if there is a direct approach for lining up 2-column > matri

Re: [R] Lining up x-y datasets based on values of x

2007-02-01 Thread Christos Hatzis
Marc, I don't think the issue is duplicates in the matching columns. The data were generated by an instrument (NMR spectrometer), processed by the instrument's software through an FFT transform and other transformations and finally reported as a sequence of chemical shift (x) vs intensity (y) pai

Re: [R] Lining up x-y datasets based on values of x

2007-02-01 Thread Christos Hatzis
ted on the time dimension. -Christos -Original Message- From: Marc Schwartz [mailto:[EMAIL PROTECTED] Sent: Thursday, February 01, 2007 4:21 PM To: [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Lining up x-y datasets based on values of x On Thu, 2007-02-01 at 15:

Re: [R] Lining up x-y datasets based on values of x

2007-02-01 Thread Christos Hatzis
:[EMAIL PROTECTED] Sent: Thursday, February 01, 2007 3:29 PM To: [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Lining up x-y datasets based on values of x On Thu, 2007-02-01 at 15:05 -0500, Christos Hatzis wrote: > Hi, > > I was wondering if there is a direct approach for li

[R] Lining up x-y datasets based on values of x

2007-02-01 Thread Christos Hatzis
c(x[,1],y[,1],z[,1])), max(c(x[,1],y[,1],z[,1])), 1) w <- cbind(xx, matrix(rep(0, 3*length(xx)), ncol=3)) w[ xx >= x[1,1] & xx <= x[10,1], 2 ] <- x[,2] w[ xx >= y[1,1] & xx <= y[10,1], 3 ] <- y[,2] w[ xx >= z[1,1] & xx <= z[10,1], 4 ] <- z[,2] w I app

Re: [R] Loading functions in R

2007-01-31 Thread Christos Hatzis
. Finally attach(myFunctions.RData) should do the trick without cluttering your workspace. -Christos Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Tel: 781-938-3830 www.nuverabio.com -Original Message- From: [EMAIL PROTECTED] [mai

Re: [R] Matrix operations in a list

2007-01-23 Thread Christos Hatzis
Try, mapply('%*%', a, b, SIMPLIFY=FALSE) -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doran, Harold Sent: Tuesday, January 23, 2007 10:22 AM To: r-help@stat.math.ethz.ch Subject: [R] Matrix operations in a list I have matrices stored withi

Re: [R] comparing two matrices

2007-01-20 Thread Christos Hatzis
Here is a slightly more compact version of your function which might run faster (I did not test timings) since it does not use the sum: apply(mat2, 1, function(x) which(apply(mat1, 1, function(y) all(x == y)) == TRUE)) -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL

Re: [R] simple q: returning a logical vector of substring matches

2007-01-20 Thread Christos Hatzis
You can try the following: a == grep("ear", a, value=T) -Christos Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Tel: 781-938-3830 www.nuverabio.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Re: [R] how to get the index of entry with max value in an array?

2007-01-17 Thread Christos Hatzis
Or which.max(a) -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of talepanda Sent: Wednesday, January 17, 2007 11:45 PM To: Feng Qiu Cc: r-help@stat.math.ethz.ch Subject: Re: [R] how to get the index of entry with max value in an array? In R lang

Re: [R] A vectorization question

2007-01-09 Thread Christos Hatzis
everse the sort order. Of course, if the matrices are "relatively" small, sorting time would likely be a non-issue. HTH, Marc On Tue, 2007-01-09 at 16:39 -0500, Christos Hatzis wrote: > Thanks, Marc. > This is what I was trying to do but

Re: [R] A vectorization question

2007-01-09 Thread Christos Hatzis
e, 2007-01-09 at 16:10 -0500, Christos Hatzis wrote: > Hi, > > A function calculates the absolute difference between the two largest > values of each row of a matrix, as shown in the following example code: > > cx <- matrix(runif(15),5) > cy <- t( apply(cx, 1, order,

[R] A vectorization question

2007-01-09 Thread Christos Hatzis
iff(cx[i, cy[i,1:2]])) Anybody has any ideas on how the last loop can be vectorized? Thanks. Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Tel: 781-938-3830 www.nuverabio.com <http://www.nuverabio.com/> __

Re: [R] vectorizing an iterative process.

2006-12-26 Thread Christos Hatzis
. -Christos Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Tel: 781-938-3830 www.nuverabio.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Geoffrey Zhu Sent: Tuesday, December 26, 2006 11:06 AM To: r

Re: [R] how to 'get' an object that is part of a list

2006-12-25 Thread Christos Hatzis
vantage of eliminating the eval. On 12/25/06, Christos Hatzis <[EMAIL PROTECTED]> wrote: > Thank you Gabor. Very interesting solution. > If I get it right, the first argument in function f is just a > placeholder to help extract the right element out of the list(...) > that is passed

Re: [R] how to 'get' an object that is part of a list

2006-12-24 Thread Christos Hatzis
" > > > eval(parse(text='xx$a')) > [1] 1 2 3 4 5 > > > > So that way you can pass in the character string and then 'parse' it. > > > > On 12/24/06, Christos Hatzis <[EMAIL PROTECTED]> wrote: > > > > This might be

Re: [R] how to 'get' an object that is part of a list

2006-12-23 Thread Christos Hatzis
1 2 3 4 5 $b [1] "a" "b" "c" "d" "e" > eval(parse(text='xx$a')) [1] 1 2 3 4 5 > So that way you can pass in the character string and then 'parse' it. On 12/24/06, Christos Hatzis <[EMAIL PROTECTED]> wrote:

[R] how to 'get' an object that is part of a list

2006-12-23 Thread Christos Hatzis
n(...) { names <- as.character(substitute(list(...)))[-1] sapply(names, FUN=function(x){y <- get(x); length(y)}) } > my.length(xx) xx 2 > my.length(xx$a) Error in get(x, envir, mode, inherits) : variable "xx$a" was not found > my.length(xx$a, xx$b) Error i

Re: [R] Speeding up small functions

2006-11-19 Thread Christos Hatzis
-Christos Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Tel: 781-938-3830 www.nuverabio.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wee-Jin Goh Sent: Sunday, November 19, 2006 4:26 PM T

Re: [R] X-fold cross validation function for discriminant analysis

2006-11-16 Thread Christos Hatzis
Apologies for the typos there. I meant to say see the Bioconductor web site for details. -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Christos Hatzis Sent: Thursday, November 16, 2006 11:53 AM To: 'Wensui Liu'; 'Wade W

Re: [R] X-fold cross validation function for discriminant analysis

2006-11-16 Thread Christos Hatzis
One option is the Bioconductor package MLInterfaces that provides a unified interface for several machine learning alrogirithms and methods for cross-validation etc. See the algorithms web site for details. -Christos Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite

Re: [R] Matrix-vector multiplication without loops

2006-11-14 Thread Christos Hatzis
#x27;vectorized' system.time( { ind <- sapply(1:(K+1), seq, length = K+1) cc <- outer(cf,cf) p.2 <- apply(U, 1, FUN=function(u) sum(cc * u[ind])) } ) all.equal(p.1, p.2) rm(n,K,p,U,cf,cc,ind,p.1,p.2) -Christos Christos Hatzis, Ph.D. Nuvera Biosciences, Inc

Re: [R] R and Fortran 9x -- advice

2006-11-13 Thread Christos Hatzis
Mike, Can you recommend any good books on Fortran 90/95? I had been an old user of Fortran 77 but haven't followed the developments in the last 15 years or so... Thanks. Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Tel: 781-938

Re: [R] CPU or memory

2006-11-08 Thread Christos Hatzis
Great. I will try it. Thank you. -Christos -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 08, 2006 1:21 PM To: Christos Hatzis Cc: 'Stefan Grosse'; r-help@stat.math.ethz.ch; 'Taka Matzmoto' Subject: RE: [R] CPU or m

Re: [R] CPU or memory

2006-11-08 Thread Christos Hatzis
nterested in running Monte-Carlo cross-validation in some sort of a parallel mode on a dual core (Pentium D) Windows XP machine. Thank you. -Christos Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Tel: 781-938-3830 www.nuverabio.com -Origin

Re: [R] subsetting a matrix and filling other

2006-11-07 Thread Christos Hatzis
Use a list to store the partial matrices: z <- vector("list", 189) for(i in 1:189) z[[i]] <- subset(...) -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of antonio rodriguez Sent: Tuesday, November 07, 2006 2:01 PM To: R-Help Subject: [R

Re: [R] alist()

2006-11-06 Thread Christos Hatzis
You need to start by first allocating the list. The problem is that you cannot reference a list member that does not exist yet (as in x$two): x <- vector("list", 10) x List x has 10 NULL elements by default. You can then assign values to these as needed. -Christos -Original Message-

Re: [R] Subset and levels

2006-11-06 Thread Christos Hatzis
Hi Florent, A simple example with the expected output would help. If I understood correctly what you want, perhaps the following would work: X[ X$code %in% levels(Y$code), ] assuming Y$code is a factor. If not, you can used instead unique(Y$code) in the above. -Christos -Original Messag

Re: [R] How to obtain the estimate of baseline survival function?

2006-11-03 Thread Christos Hatzis
See ?basehaz in 'survival' package. -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Zheng Yuan Sent: Friday, November 03, 2006 6:20 PM To: r-help@stat.math.ethz.ch Subject: [R] How to obtain the estimate of baseline survival function? Hi, If

Re: [R] multiple plots in the same graph

2006-11-03 Thread Christos Hatzis
See ?points and ?lines for adding new groups of points or lines to an existing graph created by plot. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Li Zhang Sent: Friday, November 03, 2006 9:55 PM To: R-help@stat.math.ethz.ch Subject: [R] multiple plots

Re: [R] psigamma derivative

2006-10-30 Thread Christos Hatzis
Try ?Special For information on the special functions included in the base R distribution. Also, RSiteSearch("digamma") gives several hits on additional packages that might be useful. -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL

Re: [R] help fo finding R package "utils"

2006-10-26 Thread Christos Hatzis
R] help fo finding R package "utils" sir i have downloaded poptools for excel to import data but still feeling problems. I am not understanding what I should do? On 10/26/06, Christos Hatzis <[EMAIL PROTECTED]> wrote: Amina, The best way for enterin

Re: [R] help fo finding R package "utils"

2006-10-26 Thread Christos Hatzis
d sir I have a great problem for data entry in R. using sessionInfo() utils has appeared. but while entring data there is a message of no object found. Sir is there any option for spreadsheet for data entry. I shall be thankful to you. Amina On 10/25/06, Christos Hatzis <[EMAIL PROTECTED]> w

Re: [R] help fo finding R package "utils"

2006-10-25 Thread Christos Hatzis
Amina, utils is a base package and should be already installed in a functional R system. You can try sessionInfo() to verify that it is loaded. -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of amna khan Sent: Thursday, October 26, 2006 12:11

Re: [R] avoiding a loop

2006-10-24 Thread Christos Hatzis
Try this (essentially the trick is to shift the invector to get the y[i-i] effect): constructLt<-function(invector, a=1) { invector[invector aa <- c(1,1,0.5,2,3,0.4,4,5) > aa [1] 1.0 1.0 0.5 2.0 3.0 0.4 4.0 5.0 > constructLt(aa) [1] 1.0 1.0 0.5 2.0 3.0 1.2 4.0 5.0 -Christos -Original Mes

Re: [R] Plotmath expression

2006-10-24 Thread Christos Hatzis
@stat.math.ethz.ch Subject: Re: [R] Plotmath expression Christos Hatzis wrote: > Hello, > > I've been trying to plot a subscript in a text formula using plotmath > but I haven't been able to do so. > > In my example below I would like the text label to show X[min] =

[R] Plotmath expression

2006-10-24 Thread Christos Hatzis
, collapse="+/-") text(x=9, y=2, pos=2, expression(paste(X[min], "=", ll.txt))) Any help is much appreciated. Thanks. Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Tel: 781-938-3830 www.nuverabio.com ___

Re: [R] help with coef

2006-10-20 Thread Christos Hatzis
Tom, coef returns a "named" vector, which is a vector with an extra attribute called "names". To remove the extra attribute you can: names(a) <- NULL# through the accessor function [EMAIL PROTECTED] <- NULL # directly accessing the attribute names or by creating a new vector as you

Re: [R] sort question in a dataset?

2006-10-14 Thread Christos Hatzis
Another way to do this is: o <- order(a[,"y"],-a[,"x"], decreasing=TRUE) a[o,] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Richard M. Heiberger Sent: Sunday, October 15, 2006 1:32 AM To: zhijie zhang Cc: R-help@stat.math.ethz.ch Subject: Re: [R] sort

Re: [R] combinatorics

2006-10-13 Thread Christos Hatzis
ue(pp) > res [1] "CBBAA" "BCBAA" "BBCAA" "CBABA" "BCABA" "CABBA" "ACBBA" "BACBA" "ABCBA" "BBACA" "BABCA" [12] "ABBCA" "CBAAB" "BCAAB" "CABAB" &

Re: [R] The W statistic in wilcox.exact

2006-10-05 Thread Christos Hatzis
atistic # or wilcox.test( 1:5 ~ factor(c(1,1,0,0,0)) )$statistic W 6 So there does not appear to be a difference between the two methods. Did I miss something? -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Christos Hatzis Sent: Thursda

Re: [R] The W statistic in wilcox.exact

2006-10-05 Thread Christos Hatzis
Probably because of the offset: U = W - n*(n+1)/2 In your example, W=12 (=3+4+5) as reported by wilcox.test. The offset is 6 (=3*4/2) and therefore U=6. I am not certain as I haven't installed the exactRankTests package, but it seems that wilcox.exact reports U instead of W. -Christos H

Re: [R] inserting columns in the middle of a dataframe

2006-09-13 Thread Christos Hatzis
I've found the following method to work: e.g. for df <- data.frame(v1,v2,v3,v4) use: df <- data.frame(df[1:2],v5,df[-c(1:2)]) I *believe* this is the one-line solution I was looking for. Can anyone see why this wouldn't work? Jon -----Original Message- From: Christos Hatzis

Re: [R] inserting columns in the middle of a dataframe

2006-09-13 Thread Christos Hatzis
See ?append -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jon Minton Sent: Wednesday, September 13, 2006 5:14 PM To: r-help@stat.math.ethz.ch Cc: 'Jon Minton' Subject: Re: [R] inserting columns in the middle of a dataframe Dear R users:

Re: [R] rename cols

2006-09-11 Thread Christos Hatzis
Try this: old.colnames <- colnames(my.439.vars.df) old.colnames[old.colnames=="fksm"] <- "new.name.a" old.colnames[old.colnames=="klmk"] <- "new.name.b" I don't think it would be too complicated to put this into a function. -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[

Re: [R] Matrix multiplication using apply() or lappy() ?

2006-09-06 Thread Christos Hatzis
See ?sweep sweep(a, 2, a[1,],"/") -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Wednesday, September 06, 2006 11:49 AM To: r-help@stat.math.ethz.ch Subject: [R] Matrix multiplication using apply() or lappy() ? I am

Re: [R] Quick question about lm()

2006-09-04 Thread Christos Hatzis
Say, my.lm <- lm(y ~ x, data=my.data) Then if you try: names(summary(my.lm)) you will see the components of the summary.lm object. The coefficients and t-statistics can be extracted by summary(my.lm)$coefficients and similarly for the r-squared and other statistics provided in the summary r

Re: [R] Plots Without Displaying

2006-08-16 Thread Christos Hatzis
eld ~ site, data=barley) plotList[[2]] <- xyplot(yield ~ variety, data=barley) plotList[[3]] <- xyplot(yield ~ year, data=barley) plotList plotList[[3]] <- update(plotList[[3]], yaxis="Yield (bushels/acre)") print(plotList[[3]]) Obviously, you can store any lattice-based plot in t

Re: [R] invisible() - does not return immediately as return() does

2006-08-11 Thread Christos Hatzis
Hi, The difference is in the _return_ value of the function. E.g. > foo <- function() { cat("before\n"); cat("after\n"); return("done")} > foo() before after [1] "done" i.e. returns the return value "done". However > foo2 <- function() { cat("before\n"); cat("after\n"); invisible("done")} > foo

Re: [R] Pairwise n for large correlation tables?

2006-08-07 Thread Christos Hatzis
Hi, You can use complete.cases It should run faster than the code you suggested. See following example: x <- matrix(runif(30),10,3) # introduce missing values x[sample(1:10,3),1] <- NA x[sample(1:10,3),2] <- NA x[sample(1:10,3),3] <- NA cor(x,use="pairwise.complete.obs") n <- ncol(x) n.na <-

Re: [R] inserting rows into a matrix

2006-07-27 Thread Christos Hatzis
x27;t work because in my application f(A2) will fail if there are any zeroes in A2. cheers rksh On 27 Jul 2006, at 15:10, Christos Hatzis wrote: > This is not as elegant, but should work: > > a3 <- f(A2) > a3[ which( apply(a3,1,prod) == 0 ), ] <- rep(0,ncol(a3)) > a3 &

Re: [R] inserting rows into a matrix

2006-07-27 Thread Christos Hatzis
This is not as elegant, but should work: a3 <- f(A2) a3[ which( apply(a3,1,prod) == 0 ), ] <- rep(0,ncol(a3)) a3 Essentially use the product to pick out the rows with at least one 0 and replace these rows with 0s. HTH. -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL

Re: [R] bilinear regression

2006-07-18 Thread Christos Hatzis
elpful the discussion and example in Ch.10 of Venables & Ripley, 4th ed, that introduces the concepts behind random and mixed effects models. -Christos Christos Hatzis, Ph.D. Vice President, Technology Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Tel

Re: [R] String manipulation and formatting

2006-07-17 Thread Christos Hatzis
XX" and "XXX". So xify(4.1) should produce "XXX.X" as character string. Any pointers? Or did I miss something with formatC? -Original Message- From: Christos Hatzis [mailto:[EMAIL PROTECTED] Sent: Monday, July 17, 2006 16:21 To: Bashir Saghir (Aztek Globa

Re: [R] String manipulation and formatting

2006-07-17 Thread Christos Hatzis
See ?formatC You might need to write a simple wrapper function to implement the interface that you want. -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bashir Saghir (Aztek Global) Sent: Monday, July 17, 2006 10:07 AM To: '[EMAIL PROTECTED]'

Re: [R] Negative value on ternaryplot

2006-05-18 Thread Christos Hatzis
Ternary plots are typically used to plot triplets of values (e.g. composition of 3 components) that add up to 100% or 1. In this context, I am not sure what a negative value means. Do the 3 numbers in your application still add up to 100%? Alternatively, would it be meaningful to translate the da

Re: [R] create a vector

2006-05-17 Thread Christos Hatzis
paste("A", 1:300, sep="") -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of YIHSU CHEN Sent: Thursday, May 18, 2006 12:56 AM To: R-help@stat.math.ethz.ch Subject: [R] create a vector Dear R users: I have an elementary question: how to creat a vector of [

Re: [R] everytime I download a new version of R, need I reinstall all packages?

2006-05-16 Thread Christos Hatzis
The process that you outlined is described in the Windows R FAQ 2.8 "What's the best way to upgrade?". The same process should apply to other platforms as well, but I don't think it is in the general R FAQ. Perhaps it should. -Christos -Original Message- From: [EMAIL PROTECTED] [mailt

Re: [R] remove Punctuation characters

2006-05-09 Thread Christos Hatzis
Try gsub('[[:punct:]]', '', str) -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Filipe Almeida Sent: Tuesday, May 09, 2006 11:51 AM To: r-help@stat.math.ethz.ch Subject: [R] remove Punctuation characters Hi, I want to remove all punctuatio

Re: [R] predict.lm

2006-05-02 Thread Christos Hatzis
I think you got it right. The mean of the (weighted) sum of a set of random variables is the (weighted) sum of the means and its variance is the (weighted) sum of the individual variances (using squared weights). Here you don't have to worry about weights. So what you proposed does exactly this.

Re: [R] random walk on graph

2006-04-27 Thread Christos Hatzis
I did not look at your code in detail, but I see a potential problem in your inner loop. I think you intended k to be in 2,3,...N+1. What you get from your code is (2:N)+1 according to the operator precedence rules. You need 2:(N+1). HTH, -Christos -Original Message- From: [EMAIL PROT

Re: [R] copying previously installed libraries to R 2.3.0

2006-04-26 Thread Christos Hatzis
See Windows FAQ 2.8 - works well. -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Thomas Harte Sent: Wednesday, April 26, 2006 2:54 PM To: r-help@stat.math.ethz.ch Subject: [R] copying previously installed libraries to R 2.3.0 hi all, is the

[R] variable labels in pairs

2006-04-25 Thread Christos Hatzis
Hello, I am using 'pairs' to produce a scatter plot matrix with a custom upper.panel function to plot the Pearson's correlation coefficients for the pairs of variables. I would like to be able to use the actual variable names as subscripts in rho in the printed text. I know these labels are ac

Re: [R] Store results of for loop

2006-04-24 Thread Christos Hatzis
It is not very clear how you want to index your results vector. If ss contains the indices of the results vector that you are trying to change, this implies that you have a vector of length 9. In this case results <- numeric(max(ss)) results[ss] <- ss + 1 will do the trick. Or in case that ss

Re: [R] how to do Splus compare() function in R

2006-04-20 Thread Christos Hatzis
As suggested below, sign(ii*1e9-f) will give you the same result as the S-plus compare(ii*1e-9,f) -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bellinger Instruments P/L Sent: Thursday, April 20, 2006 11:02 PM To: 'Prof Brian Ripley' Cc:

Re: [R] The contrary of command %in%

2006-04-20 Thread Christos Hatzis
A flexible way for doing this is to define logical vectors for the types of samples that you want to include or exclude. You can then use logical negation to select the complementary set: inSet1 <- HData$H < 1.3 inSet2 <- HData$H < 8 & Hdata$DBH > 20 HDataPart1 <- Hdata[!inSet1, ] HDataPart2 <-

Re: [R] Basic vector operations was: Function to approximatecomplex integral

2006-04-19 Thread Christos Hatzis
You get the same result with sum(outer(a,b)) -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of jim holtman Sent: Wednesday, April 19, 2006 3:32 PM To: Doran, Harold Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Basic vector operations was: Funct

Re: [R] how funciton "expression" produces subscript

2006-04-18 Thread Christos Hatzis
See ?plotmath for the answer to your question and many more regarding math expression drawing. It might be worth printing this help page for future reference. -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jing Yang Sent: Tuesday, April 18, 20

  1   2   >