Re: [R] Additional arguments in S3 method produces a warning

2006-03-15 Thread Martin Maechler
> "HenrikB" == Henrik Bengtsson <[EMAIL PROTECTED]> > on Thu, 16 Mar 2006 07:48:49 +0100 writes: HenrikB> It is even better/more generic(!) to have: HenrikB> extract <- function(...) UseMethod("extract") HenrikB> "Specifying the object argument or the method HenrikB>

Re: [R] Additional arguments in S3 method produces a warning

2006-03-15 Thread Henrik Bengtsson
It is even better/more generic(!) to have: extract <- function(...) UseMethod("extract") "Specifying the object argument or the method arguments of a generic function will restrict any other methods with the same name to have the same argument. By also excluding the object argument, default fun

[R] ANCOVA with random factor

2006-03-15 Thread David Semmens
I would like to know if there is a way of directly calculating the F-ratio of a random effect using the "aov" function. I have 2 factors in my model, "population" which is random and "length" which is the length of female fish within each population. The dependent variable is "diam" which is th

[R] running median and smoothing splines for robust surface fitting

2006-03-15 Thread Vladislav Petyuk
Hi, Are there any multidimenstional versions of runmed() and smooth.spline() functions? I need to fit surface into quite noisy 3D data. Below is an example (2D) of kind of fittings I do. Thank you, Vlad #=generating complex x,y dataset with gaussian & uniform noise== x <- seq(1:1) x2 <- rep(

Re: [R] lapply vs. for (was: Incrementing a counter in lapply)

2006-03-15 Thread Gregor GORJANC
On 3/15/06, Thomas Lumley <[EMAIL PROTECTED]> wrote: > On Wed, 15 Mar 2006, Philippe Grosjean wrote: > > > the for() loop is very slow in S-PLUS. This is probably one of the > > motivation of developing the apply() family of functions (as well as the > > ugly For() loop) under this system. > > > >

[R] handling warning messages

2006-03-15 Thread Sigal Blay
Is there any way to store the value of warnings but avoid printing them? A simplified example: > out <- c(0.2,0.3,0.4) > var <- c(2,3,4) > outcome <- glm(out ~ var, family=binomial()) Warning message: non-integer #successes in a binomial glm! in: eval(expr, envir, enclos) I don't like the warning

Re: [R] "\r" with RSQLite

2006-03-15 Thread Mikkel Grum
Thanks for the tip. I've attempted the alternative approach of using write.table, which allows you to see the file and import it directly. Would the carriage returns be visible with notepad or with the edit command? Because I don't see the /r in the text file, but still get it when I query the data

[R] excluding factor levels with read.table() and colClasses=

2006-03-15 Thread Peter Tait
Hi, I am reading a "|" delimited text file into R using read.table(). I am using colClasses= to specify some variables as factors. Some of these variables include missing values coded as "NA". Unfortunately the R code I am using (pasted bellow) includes "NA" as one of the factor levels. Is it

Re: [R] How to get correct proportions/bounding box for latex figure?

2006-03-15 Thread Duncan Murdoch
context grey wrote: > That's approximately right, but the individual > scatterplots > are slightly stretched horizontally. > > Is there not any way to have the plots have true 1:1 > aspect ratio > (given that the range of the data is the same on both > axes) > and still get a bounding box?. W

[R] Having trouble with plot.survfit and fun="cloglog"

2006-03-15 Thread Kevin E. Thorpe
I'm having trouble getting fun="cloglog" to work with plot on a survfit object. Here are the data I used for the commands that follow. days status 2 0 2 0 5 1 9 0 14 1 16 0 16 0 17 0 29 1 30 0 37 1 37 0 39 1 44 0 44 0 58 0 60 1 67 1 68 1 82 1 82 1 86 0 86 0 89 1 93 0 97 1 100 0 100 0 100 0 > l

Re: [R] comparing AIC values of models with transformed, untransformed, and weighted variables

2006-03-15 Thread Ben Bolker
Patrick Baker sci.monash.edu.au> writes: What I'd like to get some advice or insight on is whether > there is an appropriate way to rescale the AIC values to permit > comparisons across these models. Any suggestions would be very welcome. > Cheers, Patrick Baker > > Not a complete solutio

Re: [R] concatenating factor from list

2006-03-15 Thread Gabor Grothendieck
On 3/15/06, Sebastian Luque <[EMAIL PROTECTED]> wrote: > Sebastian Luque <[EMAIL PROTECTED]> wrote: > > "Gabor Grothendieck" <[EMAIL PROTECTED]> wrote: > > >> Is this ok or is it what you are trying to avoid: > > >> factor(unlist(lapply(cutYield, as.character))) > > > Thank you Gabor. The problem

Re: [R] Problem compiling R-Patched

2006-03-15 Thread Kevin E. Thorpe
Liaw, Andy wrote: > Could it be that you have the environment variable R_HOME (or something like > that) defined somewhere? Just a wild guess... No, R_HOME is not defined in the shell I was compiling in, but R_LIBS was! Brilliant "wild guess." Thanks, Kevin > Andy > > From: Kevin E. Thorpe >

Re: [R] Problem compiling R-Patched

2006-03-15 Thread Liaw, Andy
Could it be that you have the environment variable R_HOME (or something like that) defined somewhere? Just a wild guess... Andy From: Kevin E. Thorpe > > I downloaded R-Patched today (to see if another problem I > want to ask about is still present or if its just me - as per > the posting gui

[R] Problem compiling R-Patched

2006-03-15 Thread Kevin E. Thorpe
I downloaded R-Patched today (to see if another problem I want to ask about is still present or if its just me - as per the posting guide). I ran "tools/rsync-recommended" successfully. I then ran "configure --enable-R-shlib" successfully. Then make stops with the following error. gcc -shared -

Re: [R] Surv object in data.frame

2006-03-15 Thread Thomas Lumley
On Thu, 16 Mar 2006, Heinz Tuechler wrote: > > Thank you, Thomas. You are right, it works, but why then I find on the help > page for Surv{survival} the following sentence: > "To include a survival object inside a data frame, use the I() function. > Surv objects are implemented as a matrix of 2 or

Re: [R] Surv object in data.frame

2006-03-15 Thread Heinz Tuechler
At 11:59 15.03.2006 -0600, Robert Baer wrote: >This does work: >coxph(survobj~group, data=df.test[[1]]) # this works like your original > >To get insight compare: >str(survobj) >str(df.test) >str(df.test[[1]]) Thank you for your answer. It seems to me that your solution only works, as long as the

Re: [R] concatenating factor from list

2006-03-15 Thread Sebastian Luque
Sebastian Luque <[EMAIL PROTECTED]> wrote: "Gabor Grothendieck" <[EMAIL PROTECTED]> wrote: >> Is this ok or is it what you are trying to avoid: >> factor(unlist(lapply(cutYield, as.character))) > Thank you Gabor. The problem with that is what if some levels do not > appear in any member of cut

Re: [R] Surv object in data.frame

2006-03-15 Thread Heinz Tuechler
At 09:23 15.03.2006 -0800, Thomas Lumley wrote: >On Wed, 15 Mar 2006, Heinz Tuechler wrote: > >> Dear All, >> >> a Surv object I put in a data frame behaves somehow unexpected (see example). >> If I do a Cox regression on the original Surv object it works. If I put it >> in a data.frame and do the

Re: [R] concatenating factor from list

2006-03-15 Thread Gabor Grothendieck
Since all components of cutYield have the same levels, one could do this to ensure that all levels are represented: factor(unlist(lapply(cutYield, as.character)), levels = levels(cutYield[[1]])) On 3/15/06, Sebastian Luque <[EMAIL PROTECTED]> wrote: > "Gabor Grothendieck" <[EMAIL PROTECTED]> wro

Re: [R] concatenating factor from list

2006-03-15 Thread Sebastian Luque
"Gabor Grothendieck" <[EMAIL PROTECTED]> wrote: > Is this ok or is it what you are trying to avoid: > factor(unlist(lapply(cutYield, as.character))) Thank you Gabor. The problem with that is what if some levels do not appear in any member of cutYield? In that case, the factor created above wou

[R] (no subject)

2006-03-15 Thread Linda Lei
Hi there, Can R use "principal component analysis (PCA)" to do the clustering? Or does PCA only be used to pick up the important variables? Thank you! [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https:/

Re: [R] concatenating factor from list

2006-03-15 Thread Gabor Grothendieck
Is this ok or is it what you are trying to avoid: factor(unlist(lapply(cutYield, as.character))) On 3/15/06, Sebastian Luque <[EMAIL PROTECTED]> wrote: > Hi, > > I've run into a ridiculous problem I can't find any solutions for in the > archives or help pages: > > data(barley) > cutYield <- wi

Re: [R] How to get correct proportions/bounding box for latex figure?

2006-03-15 Thread context grey
That's approximately right, but the individual scatterplots are slightly stretched horizontally. Is there not any way to have the plots have true 1:1 aspect ratio (given that the range of the data is the same on both axes) and still get a bounding box?. And, without getting out a ruler and m

[R] concatenating factor from list

2006-03-15 Thread Sebastian Luque
Hi, I've run into a ridiculous problem I can't find any solutions for in the archives or help pages: data(barley) cutYield <- with(barley, by(yield, variety, cut, breaks = c(0, 30, 60, 90))) As in this example, I'm using 'by' to return a factor for each level of another factor. The problem is t

Re: [R] Surface plot

2006-03-15 Thread Cashorali, Tanya
Hi, thanks for the help but I'm still having issues. Basically, I have two matrices of equal dimension, one should produce something similar to a heatmap.. The 2nd matrix should be the "heights" for each value of the heatmap - producing a sort of surface plot. Viewing this seems like a problem to

Re: [R] lapply vs. for (was: Incrementing a counter in lapply)

2006-03-15 Thread Thomas Lumley
On Wed, 15 Mar 2006, Philippe Grosjean wrote: > the for() loop is very slow in S-PLUS. This is probably one of the > motivation of developing the apply() family of functions (as well as the > ugly For() loop) under this system. > > Now, for() loops are much faster in R. Also, if you look at the R

Re: [R] lapply vs. for (was: Incrementing a counter in lapply)

2006-03-15 Thread Patrick Burns
In my opinion the main issue between using 'for' and an apply function is the simplicity of the code. If it is simpler and more understandable to use 'lapply' than a 'for' loop in a situation, then use 'lapply'. If in a different situation it is the 'for' loop that is simpler, then use the 'for'

Re: [R] lapply vs. for (was: Incrementing a counter in lapply)

2006-03-15 Thread Philippe Grosjean
the for() loop is very slow in S-PLUS. This is probably one of the motivation of developing the apply() family of functions (as well as the ugly For() loop) under this system. Now, for() loops are much faster in R. Also, if you look at the R code in apply(), you will realize that there is a for

[R] lapply vs. for (was: Incrementing a counter in lapply)

2006-03-15 Thread Gregor Gorjanc
> From: Thomas Lumley >> >> On Tue, 14 Mar 2006, John McHenry wrote: >> >> > Thanks, Gabor & Thomas. >> > >> > Apologies, but I used an example that obfuscated the question that I >> > wanted to ask. >> > >> > I really wanted to know how to have extra arguments in >> functions that >> > would al

Re: [R] generating RANDOM ROWS from matrix

2006-03-15 Thread Berton Gunter
?sample You must use replace=FALSE to guarantee 1000 different rows mymatrix[sample(12000,1000,replace=FALSE),] -- 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 >

Re: [R] generating RANDOM ROWS from matrix

2006-03-15 Thread Doran, Harold
Is something like this what your looking for: x <- matrix(c(rnorm(100)),ncol=10) sub <- sample(5, replace=TRUE) # For sampling with replacement x[sub,] Harold -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of mark salsburg Sent: Wednesday, March 15, 2

Re: [R] Additional arguments in S3 method produces a warning

2006-03-15 Thread Gabor Grothendieck
Define extract like this: extract <- function(e, n, ...) UseMethod("extract") # test -- no warning extract(tp, no.tp = FALSE, peak = TRUE, pit = FALSE) On 3/15/06, Philippe Grosjean <[EMAIL PROTECTED]> wrote: > Hello, > I just notice this: > > x <- c(1:4,0:5, 4, 11) > > library(pastecs) > Load

[R] generating RANDOM ROWS from matrix

2006-03-15 Thread mark salsburg
Dear group, I would like to generate a 1000 random rows from a MATRIX with dimensions 12,000 by 20 (i.e. to generate a 1000 by 20 matrix of random rows) Does the function sample() work for this??? thank you in advance [[alternative HTML version deleted]] ___

[R] Additional arguments in S3 method produces a warning

2006-03-15 Thread Philippe Grosjean
Hello, I just notice this: > x <- c(1:4,0:5, 4, 11) > library(pastecs) Loading required package: boot > tp <- turnpoints(x) > extract(tp, no.tp = FALSE, peak = TRUE, pit = FALSE) [1] FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE Warning message: arguments after the

Re: [R] which.minimums not which.min

2006-03-15 Thread Marc Schwartz (via MN)
On Wed, 2006-03-15 at 21:45 +0100, Philippe Grosjean wrote: > What Fred is looking for is local minima/maxima, also known as turning > points, or pits/peaks in a series. You can look at ?turnpoints in > pastecs library. > > > x <- c(1:4,0:5, 4, 11) > > x > [1] 1 2 3 4 0 1 2 3 4 5

Re: [R] which.minimums not which.min

2006-03-15 Thread Philippe Grosjean
What Fred is looking for is local minima/maxima, also known as turning points, or pits/peaks in a series. You can look at ?turnpoints in pastecs library. > x <- c(1:4,0:5, 4, 11) > x [1] 1 2 3 4 0 1 2 3 4 5 4 11 > tp <- turnpoints(x) > summary(tp) Turning points for: x nbr obs

Re: [R] which.minimums not which.min

2006-03-15 Thread Liaw, Andy
What you want seems to be the valleys and peaks in the data. If so, try: RSiteSearch("find peaks") which points to a post by Philippe Grosjean, pointing to the pastesc package: > library(pastecs) Loading required package: boot > tp <- turnpoints(x) > which(tp$peaks) [1] 4 10 > which(tp$pits)

Re: [R] which.minimums not which.min

2006-03-15 Thread Marc Schwartz (via MN)
On Wed, 2006-03-15 at 11:32 -0800, Fred J. wrote: > Hi > > Is there a function which determines the location, i.e., index of > the all minimums or maximums of a numeric vector. > Which.min(x) only finds the (first) of such. > > > x <- c(1:4,0:5, 4, 11) > > x >[1] 1 2 3 4

Re: [R] R icon image file

2006-03-15 Thread Christos Hatzis
http://www.r-project.org/Rlogo.jpg -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Erin Hodgess Sent: Wednesday, March 15, 2006 2:39 PM To: r-help@stat.math.ethz.ch Subject: [R] R icon image file Dear R People: I would like to include a link to the R ho

Re: [R] which.minimums not which.min

2006-03-15 Thread Christos Hatzis
Try order(x, decreasing=TRUE/FALSE) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Fred J. Sent: Wednesday, March 15, 2006 2:32 PM To: r-help@stat.math.ethz.ch Subject: [R] which.minimums not which.min Hi Is there a function which determines

Re: [R] "\r" with RSQLite

2006-03-15 Thread bogdan romocea
\r is a carriage return character which some editors may use as a line terminator when writing files. My guess is that RSQLite writes your data frame to a temp file using \r as a line terminator and then runs a script to have SQLite import the data (together with \r - this would be the problem), b

[R] R icon image file

2006-03-15 Thread Erin Hodgess
Dear R People: I would like to include a link to the R home page on a web page for students. I would like to have the "R" icon as part of the link. Where is the image file please? (for the icon) Thanks, Sincerely, Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences

[R] which.minimums not which.min

2006-03-15 Thread Fred J.
Hi Is there a function which determines the location, i.e., index of the all minimums or maximums of a numeric vector. Which.min(x) only finds the (first) of such. > x <- c(1:4,0:5, 4, 11) > x [1] 1 2 3 4 0 1 2 3 4 5 4 11 > which.min(x) [1] 5 > which.max(x) [

Re: [R] click on graph and select data points?

2006-03-15 Thread justin bem
I think you ca try >identify() - [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! ht

Re: [R] manipulating weeks dates

2006-03-15 Thread Gabor Grothendieck
I meant there are more than 7 * 52 days in a year. On 3/15/06, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > Given that there are more than 7 * 52 days in a week you may > need to think about what it is that you want. > > This will give you Jan 1 for Week 1, Jan 8 for Week 2, etc. > > as.Date(pa

Re: [R] manipulating weeks dates

2006-03-15 Thread Gabor Grothendieck
Given that there are more than 7 * 52 days in a week you may need to think about what it is that you want. This will give you Jan 1 for Week 1, Jan 8 for Week 2, etc. as.Date(paste(YEAR,1,1,sep="-")) + 7 * (WEEK - 1) That or some variation of that might be suitable. See the help desk article in

Re: [R] (newbie) Weighted qqplot?

2006-03-15 Thread Duncan Murdoch
On 3/15/2006 1:38 PM, Vivek Satsangi wrote: > Folks, > I am documenting what I finally did, for the next person who comes along... > > Following Dr. Murdoch's suggestion, I looked at qqplot. The following > approach might be helpful to get to the same information as given by > qqplot. > To summari

[R] "\r" with RSQLite

2006-03-15 Thread Mikkel Grum
What am I doing wrong, or is the \r that I'm getting in the example below a bug? > a <- (1:10) > b <- (LETTERS[1:10]) > df <- as.data.frame(cbind(a, b)) > > df a b 1 1 A 2 2 B 3 3 C 4 4 D 5 5 E 6 6 F 7 7 G 8 8 H 9 9 I 10 10 J > library(RSQLite) > drv <- dbDriver("SQLite") >

Re: [R] (newbie) Weighted qqplot?

2006-03-15 Thread Vivek Satsangi
Folks, I am documenting what I finally did, for the next person who comes along... Following Dr. Murdoch's suggestion, I looked at qqplot. The following approach might be helpful to get to the same information as given by qqplot. To summarize the ask: given x, y, xw and yw, show (visually is okay)

Re: [R] map question

2006-03-15 Thread Roger Bivand
On Tue, 14 Mar 2006, Dean Sonneborn wrote: > Would anyone with experience with the map functions know how to divide > Czechoslovakia into the Czech Republic and Slovakia. They have been two > separate countries for some time now. I'm thinking about the worldhires > map database in particular.

Re: [R] display postal codes for Germany on a map

2006-03-15 Thread Roger Bivand
On Tue, 14 Mar 2006, Stefan Pohl wrote: > Hi, > > is there an R package with which is it possible to display postal codes > for Germany on a map? If you know the geographical or projected coordinates of the postcodes, then there are plenty of possibilities, but this kind of data is typically o

[R] zeros to the left of the decimal point

2006-03-15 Thread Dimitri Joe
Hi, This one is quick: how to ask R to print "0.1" as ".1", i.e, what I want is > 0.1 .1 Many thanks, Dimitri __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-projec

Re: [R] Address matching (was R-help Digest, Vol 37, Issue 12)

2006-03-15 Thread Roger Bivand
On Sun, 12 Mar 2006, Ferran Carrascosa wrote: > Hi r-users, > > I would like to know if R have any solution to the "Address standardization". > The problem is to classify a database of addresses with the real > addresses of a streets of Spain. Ideally, I would like to assign > Postal code, census

Re: [R] Surv object in data.frame

2006-03-15 Thread Robert Baer
This does work: coxph(survobj~group, data=df.test[[1]]) # this works like your original To get insight compare: str(survobj) str(df.test) str(df.test[[1]]) Then note the 2nd sentence of the following from ?coxph Arguments: formula: a formula object, with the response on the left of a '~'

Re: [R] matrix indexing

2006-03-15 Thread tom wright
Thanks everyone. Obvious when you think about it, and you check that both the matrices your trying it with are actually matrices... instead of one being a list. On Wed, 2006-15-03 at 06:03 -0500, tom wright wrote: > Can someone please give me a pointer here. > I have two matrices > > matA >

Re: [R] Question about 'lables' & ect.

2006-03-15 Thread Marc Schwartz (via MN)
On Wed, 2006-03-15 at 17:54 +0100, jia ding wrote: > Hi, > > I have a file named: > test_R.txt > aaa 2 > bbb 5 > ccc 7 > sss 3 > xxx 8 > > I want to have a plot: > test<-read.table("test_R.txt",col.name=c("Name","Score")) > par(mfrow=c(1,2)) It's not clear what the purpose is here, at leas

Re: [R] Question about 'lables' & ect.

2006-03-15 Thread Liaw, Andy
Try something like: xp <- barplot(test$Score, space=.5) axis(1, at=xp, labels=as.character(test$Name)) See ?barplot more more detail. Andy From: jia ding > > Hi, > > I have a file named: > test_R.txt > aaa 2 > bbb 5 > ccc 7 > sss 3 > xxx 8 > > I want to have a plot: > test<-read.table("

Re: [R] Surv object in data.frame

2006-03-15 Thread Thomas Lumley
On Wed, 15 Mar 2006, Heinz Tuechler wrote: > Dear All, > > a Surv object I put in a data frame behaves somehow unexpected (see example). > If I do a Cox regression on the original Surv object it works. If I put it > in a data.frame and do the regression on the data frame it does not work. > Seemin

Re: [R] installation problem with Biobase

2006-03-15 Thread Seth Falcon
Haleh, This question would be better asked on the Bioconductor mailing list. You haven't told us what version of R you are using. I suspect you have a version mismatch. With R 2.2.x you should be able to do the following to get MergeMaid installed: >From the R prompt do: source("http://biocond

Re: [R] Setting xlim in lattice plots

2006-03-15 Thread Sundar Dorai-Raj
Mike White wrote: > I am having difficulty setting different xlim values in the lattice > histogram plot function. > An example is shown below. I think I need to convert the limits data.frame > to a list of paired values but don't know how. Any help would be > appreciated. > > library(lattice)

Re: [R] manipulating weeks dates

2006-03-15 Thread Ronaldo Reis-Jr.
Em Quarta 15 Março 2006 10:26, Gabor Grothendieck escreveu: > as.Date(paste(YEAR, WEEK, 0), "%Y %U %w") Hi, it works, but it use a year with 53 weeks, I need to use with 52 weeks, how to change this? Thanks Ronaldo -- Errigal Mountains <--> Tailoring manure -- anagrama -- |>

[R] Question about 'lables' & ect.

2006-03-15 Thread jia ding
Hi, I have a file named: test_R.txt aaa 2 bbb 5 ccc 7 sss 3 xxx 8 I want to have a plot: test<-read.table("test_R.txt",col.name=c("Name","Score")) par(mfrow=c(1,2)) barplot(test$Score) name<-test$Name axis(1,at=1:length(test$Name),labels=paste(name)) Q1, if you try the script above,you will

Re: [R] setMethod confusion -best reference for S4 programming

2006-03-15 Thread Berton Gunter
You might also wish to read the relevant chapter of V&R's S PROGRAMMING. -- 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: [EMAI

[R] Surv object in data.frame

2006-03-15 Thread Heinz Tuechler
Dear All, a Surv object I put in a data frame behaves somehow unexpected (see example). If I do a Cox regression on the original Surv object it works. If I put it in a data.frame and do the regression on the data frame it does not work. Seemingly it has to do with the class attribute, because if I

[R] Setting xlim in lattice plots

2006-03-15 Thread Mike White
I am having difficulty setting different xlim values in the lattice histogram plot function. An example is shown below. I think I need to convert the limits data.frame to a list of paired values but don't know how. Any help would be appreciated. library(lattice) mat <- as.data.frame(matrix(abs(c(

Re: [R] matrix indexing

2006-03-15 Thread vito muggeo
Dear tom, is the following what you are looking for? > a=matrix(runif(9),3,3) > a [,1] [,2] [,3] [1,] 0.9484247 0.9765431 0.6169739 [2,] 0.8423545 0.3137295 0.4031847 [3,] 0.6724235 0.1076373 0.2356923 > b<-matrix(sample(c(TRUE,FALSE),size=9,replace=TRUE),3,3) > b [

Re: [R] matrix indexing

2006-03-15 Thread Philippe Grosjean
This is really elementary indexing in S language: matA[matB] Best, Philippe Grosjean tom wright wrote: > Can someone please give me a pointer here. > I have two matrices > > matA > A B C > 1 5 2 4 > 2 2 4 3 > 3 1 2 4 > > matB >

Re: [R] matrix indexing

2006-03-15 Thread Dimitris Rizopoulos
matA[matB] or matA[!matB] Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://www.med.kuleuven.be/biostat/ http:/

Re: [R] matrix indexing

2006-03-15 Thread Andy Bunn
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of tom wright > Sent: Wednesday, March 15, 2006 6:04 AM > To: R-Stat Help > Subject: [R] matrix indexing > > > Can someone please give me a pointer here. > I have two matrices > > matA > A B

Re: [R] matrix indexing

2006-03-15 Thread Marc Schwartz (via MN)
On Wed, 2006-03-15 at 06:03 -0500, tom wright wrote: > Can someone please give me a pointer here. > I have two matrices > > matA > A B C > 1 5 2 4 > 2 2 4 3 > 3 1 2 4 > > matB > A B C > 1 TRUEFALSE TRUE

Re: [R] matrix indexing

2006-03-15 Thread Gabor Grothendieck
Try this: matA[c(matB)] In fact even this works for your example although in general it couldbe problematic since a two column matrix index has special meaning: matA[matB] On 3/15/06, tom wright <[EMAIL PROTECTED]> wrote: > Can someone please give me a pointer here. > I have two matrices > > m

[R] installation problem with Biobase

2006-03-15 Thread Haleh Yasrebi
Hello, I wanted to install MergeMaid package in v 2.2.1. I could install it but couldn't use without its dependant, Biobase. at biobase installation, I got the following error message In method for function "split": expanding the signature to include omitted arguments in definition: drop = "mi

[R] matrix indexing

2006-03-15 Thread tom wright
Can someone please give me a pointer here. I have two matrices matA A B C 1 5 2 4 2 2 4 3 3 1 2 4 matB A B C 1 TRUEFALSE TRUE 2 FALSE TRUETRUE 3 FALSE FALSE FALSE how d

[R] par(mfrow, fin) incompatibility?

2006-03-15 Thread Dan Bebber
Hello, I want a 2x1 multi-figure, with each plot 5" square. Test code: x<-rnorm(10,0,1) y<-rnorm(10,0,1) par(pty="s", mfrow=c(2,1), fin=c(5,5)) plot(x,y) plot(y,x) but this does not work (overplots the two figures). Substituting pin for fin works, but is not what I want. Are mfrow and fin incomp

Re: [R] (newbie) Weighted qqplot?

2006-03-15 Thread Duncan Murdoch
On 3/15/2006 8:31 AM, Vivek Satsangi wrote: > Folks, > Normally, in a data frame, one observation counts as one observation > of the distribution. Thus one can easily produce a CDF and (in Splus > atleast) use cdf.compare to compare the CDF (BTW: what is the R > equivalent of the SPlus cdf.compare(

Re: [R] errorbars with xyplot

2006-03-15 Thread Frank E Harrell Jr
Ronny Hannemann wrote: > Hi everyone, > > I'm very new to R and I like to learn a lot... actually I have a little > problem concerning errorbars with xyplot. > > My data look like > run target hemi x > 1 1 Nichts Links 0.0007743240 > 2 2 Nichts Links -0.0008153365 > 3 1 T

Re: [R] create a list of vectors

2006-03-15 Thread Gabor Grothendieck
Try this: L <- list(letters, head(LETTERS)) L[[2]][[4]] # D sapply(L, length) # 26 6 L <- c(L, 1:4) L[[3]][[2]] # 2 L <- c(L, list(1:5)) On 3/15/06, Arnau Mir Torres <[EMAIL PROTECTED]> wrote: > Hello. > > I want to create a list of vectors but each component of the list has a > different length

[R] (newbie) Weighted qqplot?

2006-03-15 Thread Vivek Satsangi
Folks, Normally, in a data frame, one observation counts as one observation of the distribution. Thus one can easily produce a CDF and (in Splus atleast) use cdf.compare to compare the CDF (BTW: what is the R equivalent of the SPlus cdf.compare() function, if any?) However, if each point should no

[R] (no subject)

2006-03-15 Thread Erez Shabo
Hello all, I'm trying to calculate the Maximum likelihood of individuals to get the ancestry. I mixd 3 populations 15 generations in proportion of 20% 20% 60% when each population sorce have diferent genome (0 1 and 2) with frequencies for each one. So now i have individuals looks like 0 0 2 1 1 2

Re: [R] manipulating weeks dates

2006-03-15 Thread Gabor Grothendieck
Try: as.Date(paste(YEAR, WEEK, 0), "%Y %U %w") On 3/15/06, Ronaldo Reis-Jr. <[EMAIL PROTECTED]> wrote: > Hi, > > I have these vectors: > > > WEEK <- rep(c(1:52),2) > > YEAR <- rep(c(2000,1999),c(52,52)) > > How to make a vector of Date with weeks in years? I try as.date from survival > package, b

[R] errorbars with xyplot

2006-03-15 Thread Ronny Hannemann
Hi everyone, I'm very new to R and I like to learn a lot... actually I have a little problem concerning errorbars with xyplot. My data look like run target hemi x 1 1 Nichts Links 0.0007743240 2 2 Nichts Links -0.0008153365 3 1 Target Links -0.0015825950 4 2 Target Li

Re: [R] click on graph and select data points?

2006-03-15 Thread Katharine Mullen
if you are interested in a solution using the tcltk package, then an idea is to base a solution on the code for the demo "tkcanvas". after installing the tcltk package, then require(tcltk) demo(tkcanvas) Katharine Mullen Department of Physics and Astronomy Faculty of Sciences Vrije Univers

[R] manipulating weeks dates

2006-03-15 Thread Ronaldo Reis-Jr.
Hi, I have these vectors: > WEEK <- rep(c(1:52),2) > YEAR <- rep(c(2000,1999),c(52,52)) How to make a vector of Date with weeks in years? I try as.date from survival package, but it dont work with weeks, just only with days, months etcs. Thanks Ronaldo -- "Realmente minha cidade e muito facul

[R] manipulating weeks dates

2006-03-15 Thread Ronaldo Reis-Jr.
Hi, I have these vectors: > WEEK <- rep(c(1:52),2) > YEAR <- rep(c(2000,1999),c(52,52)) How to make a vector of Date with weeks in years? I try as.date from survival package, but it dont work with weeks, just only with days, months etcs. Thanks Ronaldo -- "Realmente minha cidade e muito facul

Re: [R] GAM using R tutorials?

2006-03-15 Thread Gavin Simpson
On Tue, 2006-03-14 at 23:52 -0800, Michael wrote: > Hi all, > > I am trying to use GAM to work on some data... Are there any resources > providing hands-on tutorial/guide on how to do GAM on data in R? > Specifically, I am not sure about which model to choose, and smooth models > with which effect

Re: [R] setMethod confusion -best reference for S4 programming

2006-03-15 Thread Stephen Henderson
Thanks I think you have both answered my question (reckon Ill go S3 on that). As an adjunct to this do you know what might be the best reference to the S4 methods current implementation. I have ordered the Chambers book "Programming with Data", and I have a short tutorial-- "S4 Classes in 15 pages

Re: [R] rational and the roundoff error

2006-03-15 Thread Duncan Murdoch
On 3/15/2006 3:21 AM, Fred J. wrote: > Hi > > > I have a list of 12000 rational numbers as inputs, running some of R > functions will surly accumulate some round-off errors, Is there a way to > have R do its calculations using rational numbers as input to minimize the > round-off error? R

Re: [R] variance from correlated observations

2006-03-15 Thread Liaw, Andy
You need to know the covariance of the Xs. The sum is just a linear function of the Xs, so its variance is a function of a quadratic form involving the covariance matrix of the Xs. Andy From: Antonio, Fabio Di Narzo > > Hi all. > A statistical question. I have to estimate the variance of the su

Re: [R] R-help Digest, Vol 37, Issue 15

2006-03-15 Thread isaac . martin
Mi nueva dirección de correo es: [EMAIL PROTECTED] New e-mail address: [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Re: [R] setMethod confusion

2006-03-15 Thread Henrik Bengtsson
On 3/15/06, Martin Maechler <[EMAIL PROTECTED]> wrote: > > "Stephen" == Stephen Henderson <[EMAIL PROTECTED]> > > on Tue, 14 Mar 2006 16:32:56 - writes: > > Stephen> Hello I've checked through previous postings but > Stephen> don't see a fully equivalent problem-just a few >

Re: [R] how to use the result of hclust?

2006-03-15 Thread TEMPL Matthias
?cutree > > Hi all, > > Does hclust provide concrete clustered results? I could not > see how to use it to make 6 clusters... and it does not give > the 6 cluster labels... > > How to use the result of hclust? > > thanks a lot, > > Michael. > > [[alternative HTML version deleted]] >

Re: [R] how to use the result of hclust?

2006-03-15 Thread Jacques VESLOT
?cutree ?plot.hclust & ?identify.hclust hc<- hclust(dist(tab, "manhattan"), "ward") plot(hc, hang=-1) (x <- identify(hc)) cutree(hc, 2) Michael a écrit : >Hi all, > >Does hclust provide concrete clustered results? I could not see how to use >it to make 6 clusters... and it does not giv

[R] variance from correlated observations

2006-03-15 Thread Antonio, Fabio Di Narzo
Hi all. A statistical question. I have to estimate the variance of the sum: X(1) + X(2) + ...+ X(n) from an observed sample, where X(i) are *correlated* and not necessarly identically distributed. Someone can suggest a simple strategy (I hope by exploiting some already present R package) for obta

[R] how to use the result of hclust?

2006-03-15 Thread Michael
Hi all, Does hclust provide concrete clustered results? I could not see how to use it to make 6 clusters... and it does not give the 6 cluster labels... How to use the result of hclust? thanks a lot, Michael. [[alternative HTML version deleted]] ___

Re: [R] click on graph and select data points?

2006-03-15 Thread Philipp Pagel
> Now I want to select the best clustered class, how can I click on the data > point, and the program returns the index of that cluster(its class number, > or color number)? Have a look at identify() cu Philipp -- Dr. Philipp PagelTel. +49-8161-71 2131 Dept

[R] X11 fonts problem with ubuntu breezy

2006-03-15 Thread Martijn van Iersel
Hello I have big trouble getting R to work correctly with X11 fonts on Ubuntu Breezy 5.10. I was hoping somebody could help me with this issue. The first part of the problem is that I get the error "could not find any X11 fonts" for any command with graphical ouput, for example "demo(graphics)

[R] Log Cholesky parametrization in lme

2006-03-15 Thread Pryseley Assam
Dear R-Users I used the nlme library to fit a linear mixed model (lme). The random effect standard errors and correlation reported are based on a Log-Cholesky parametrization. Can anyone tell me how to get the Covariance matrix of the random effects, given the above mentioned parameters ba

Re: [R] difftime arguments

2006-03-15 Thread Christoph Buser
Dear Fred You should change your code from > x <- strptime(ts, "%m/%d/%y %I:%M:%S %p") to > x <- strptime(ts, "%m/%d/%Y %I:%M:%S %p") "Y" instead of "y", since your year includes the century (2006 and not 06) Then it should work. Regards, Christoph

Re: [R] create a list of vectors

2006-03-15 Thread François MICHONNEAU
Hello, I don't know if it is the most efficient way to do but my solution is: x <- vector("list", 10) #creates a list with a length = 10 then in my loop (where i is iterated) : x[[i]] <- my.vector I hope this could help you François Michonneau Hello. I want to create a list of vectors bu

  1   2   >