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

2006-03-15 Thread Martin Sandiford
Does this do what you want? library(lattice) rand1 - rnorm(50) rand2 - rnorm(50) theplot - xyplot(rand1 ~ rand2, xlab=x axis, ylab=y axis) thefile - plotproblem.eps trellis.device(postscript, file=thefile, color=F, horizontal=FALSE, width=12, height=4, paper=special) print(theplot,

[R] difftime arguments

2006-03-15 Thread Fred J.
Hi I just started using RGui.exe under widnows. I have a text file containing date arranged in columns and rows, each column has the same format, each row with different formats. 3 of the columns are something like this 1/12/2006 3:59:45 PM I need to calculate the different in seconds

[R] rational and the roundoff error

2006-03-15 Thread Fred J.
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? thanks

Re: [R] Help on factanal.fit.mle

2006-03-15 Thread Sumanta Basak
In mva package, try ?prcomp. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of souvik banerjee Sent: Wednesday, March 15, 2006 12:44 PM To: r-help@stat.math.ethz.ch Subject: [R] Help on factanal.fit.mle Hi Can anybody please suggest me about the

Re: [R] Help on factanal.fit.mle

2006-03-15 Thread Sumanta Basak
Try this link also. http://tolstoy.newcastle.edu.au/R/help/02b/0943.html -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of souvik banerjee Sent: Wednesday, March 15, 2006 12:44 PM To: r-help@stat.math.ethz.ch Subject: [R] Help on factanal.fit.mle Hi Can

[R] create a list of vectors

2006-03-15 Thread Arnau Mir Torres
Hello. I want to create a list of vectors but each component of the list has a different length. For example: Example=list() Example=list(Example,c(1,2,3)) Example=list(Example,c(11,12,13,14,15)) If I want the first component of the Example list, I have to write: Example[[1]][[2]]. R

Re: [R] GAM using R tutorials?

2006-03-15 Thread TEMPL Matthias
Have you looked at: An Introduction to R: Software for StatisticalModelling Computing by Petra Kuhnert and Bill Venables which is available at http://cran.r-project.org/other-docs.html Hope this helps. Best, Matthias Hi all, I am trying to use GAM to work on some data... Are there any

Re: [R] setMethod confusion

2006-03-15 Thread Martin Maechler
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 Stephen hints. I have been trying to set a new method for Stephen the

[R] click on graph and select data points?

2006-03-15 Thread Michael
Hi all, I am doing some clustering and the clustered results are presented in a pairs plot showing 4 clusters... I made the data points belong to 4 different clusters displaying different colors. Now I want to select the best clustered class, how can I click on the data point, and the program

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 but

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

[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

[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):

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] 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]]

[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

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 give the 6

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] 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 Stephen hints. I

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] 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 sum:

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 has no

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] 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 effective

[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

[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

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

[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

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, but it dont work

[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

[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

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. For

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 Target

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()

[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

[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

[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 =

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 matA

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 2

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 C 1

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/

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 A

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 [,1]

[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 -

[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

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 VR'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: [EMAIL

[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 get 5

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 -- | // |

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) mat -

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:

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. Seemingly

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:

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 least in this example.

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 A

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] 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 data

[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!

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 only

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] (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

[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) con -

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 summarize the

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] 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.

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!

[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) [1]

[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

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),

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

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

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 0 1 2 3

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) [1]

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

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 4 11

[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 first

[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]]

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) Loading required

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,

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

[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 allow, per the example code, 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

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 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 code

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

[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

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

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 -

[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

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 would

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] wrote:

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 regression

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 cutYield?

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] 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 3

[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] 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

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 I

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 with that is what if

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

2006-03-15 Thread Ben Bolker
Patrick Baker patrick.baker at 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

[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

  1   2   >