[R] [R-pkgs] General mixed effects Cox models

2009-10-04 Thread Terry Therneau
After an extremely long gestation, a new version of the coxme package is now available on CRAN. This function fits very general mixed-effects Cox models using an lmer-like syntax. For instance here is a model that fits a random treatment effect, using data from a multi-study collaboration. fi

[R] Help in the mtext function

2009-10-04 Thread RAVI KAPOOR
Hi Can anyone please help me in understanding the utility of "padj" and "outer (logical)" values in the '*mtext function*' given below are the output I generated on using the below code which is different from the formula description on r help > par(mfrow=c(2,1),xpd=NA) > y1 <- rnorm(100) > plot

[R] Saving each output of a loop into something that can be graphed

2009-10-04 Thread RRRRRR99
Hi, from the code below; whats happening is i want to plot how the [1,9] entry changes as the matrx changes, print[] gives the values one after the other, but only the last value is saved so my graph has only one point. does anyone know how i can merge all the outputs into one dataframe or somet

[R] The nature of evidence (was Re: Urgently needed Exercise solutions related to PracticalData)

2009-10-04 Thread Patrick Connolly
On Sat, 03-Oct-2009 at 11:35PM -0400, Daniel Malter wrote: |> This person has probably mistaken "expelsior" for "excelsior." |> |> However, be that as it may, I am personally annoyed by your |> statement, David, in which you indicate that you believe this to be |> an MBA/business school problem,

Re: [R] Parsing Files in R (USGS StreamFlow data)

2009-10-04 Thread stephen sefick
Thanks for the help - this was my goal sorry for not being straight forward enough #021973269 is the Waynesboro Gauge on the Savannah River Proper (SRS) #02102908 is the Flat Creek Gauge (ftbrfcms) #02133500 is the Drowning Creek (ftbrbmcm) #02341800 is the Upatoi Creek Near Columbus (ftbn) #02342

Re: [R] Modify base R functions in Rprofile.site

2009-10-04 Thread Yihui Xie
Hi Charlie, Thanks a lot! Your "dark voodoo" really helps! And also, thanks so much to Duncan for your detailed explanation! Finally I used Charlie's trick to modify makeRweaveLatexCoderunner(), and has left parse() & deparse() untouched. Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: htt

Re: [R] split-apply question

2009-10-04 Thread Kavitha Venkatesan
Thanks to everyone for the different suggestions! Very useful. PS: The "aggregate" function based solution didnt work as-is for me, perhaps it needs some modification? Thanks again, On Fri, Oct 2, 2009 at 1:51 PM, William Dunlap wrote: > > > -Original Message- > > From: r-help-boun...

[R] Gaussian Maximum Likelihood Classification

2009-10-04 Thread Alexandre Serra Barreto
__ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] Welcome to the "R-help" mailing list

2009-10-04 Thread Alexandre Serra Barreto
__ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

[R] Ubuntu, Revolutions, R

2009-10-04 Thread Andrew Choens
For those who don't follow Ubuntu development carefully, the first Beta for the next Ubuntu was recently released, so I took my home system and upgraded to help out with filing bugs, etc. Just to be clear, I am not looking for help with the upgrade process. I've had R, and a few miscellaneous

Re: [R] Parsing Files in R (USGS StreamFlow data)

2009-10-04 Thread Rolf Turner
On 5/10/2009, at 2:49 PM, stephen sefick wrote: http://waterdata.usgs.gov/nwis/uv? format=rdb&period=7&site_no=021973269 I would like to be able to parse this file up: I can do this x <- read.table("http://waterdata.usgs.gov/nwis/uv? format=rdb&period=7&site_no=021973269", skip=26) but If

Re: [R] Parsing Files in R (USGS StreamFlow data)

2009-10-04 Thread Gabor Grothendieck
Its not completely clear what you want to preserve and what you want to eliminate but try this: > L <- > readLines("http://waterdata.usgs.gov/nwis/uv?format=rdb&period=7&site_no=021973269,06018500";) > L.USGS <- grep("^USGS", L, value = TRUE) > DF <- read.table(textConnection(L.USGS), fill = TRU

[R] Parsing Files in R (USGS StreamFlow data)

2009-10-04 Thread stephen sefick
http://waterdata.usgs.gov/nwis/uv?format=rdb&period=7&site_no=021973269 I would like to be able to parse this file up: I can do this x <- read.table("http://waterdata.usgs.gov/nwis/uv?format=rdb&period=7&site_no=021973269";, skip=26) but If I add another gauge to this x <- read.table("http://

Re: [R] Ask about the memory size problem

2009-10-04 Thread David Winsemius
On Oct 4, 2009, at 9:22 PM, Yi Du wrote: Hi there, I run a loop program with R and need to save the variable in each step into a vector. Data? Code? After I ran the code, R told me that Error: cannot allocate vector of size 266.6 Mb. Is there any solution of this kind of problem? Tha

Re: [R] update'ing trellis object

2009-10-04 Thread David Winsemius
On Oct 4, 2009, at 7:23 PM, David Winsemius wrote: I wonder if you noticed that you had managed to create a "fig" object that has two "inside" lists by specifying first a key "list" which required a legend list, and then specifying a "legend" list that also had a key function? The solution

[R] Ask about the memory size problem

2009-10-04 Thread Yi Du
Hi there, I run a loop program with R and need to save the variable in each step into a vector. After I ran the code, R told me that Error: cannot allocate vector of size 266.6 Mb. Is there any solution of this kind of problem? Thank you for your attention. Yi -- Yi Du [[alternative

Re: [R] multicore - no parallel

2009-10-04 Thread David M Smith
On Sat, Oct 3, 2009 at 7:13 PM, dunno87  wrote: > Thanks for the help in advance. I just want to know if there is absolutely > any way of using multicore if my loop can't run in parallel as each > iteration depends on the previous iteration. I have Windows R 2.9.2 and > REvolution R Enterprise 2.0

[R] CRAN (and crantastic) updates this week

2009-10-04 Thread Crantastic
CRAN (and crantastic) updates this week New packages * EQL (1.0-0) Thorn Thaler http://crantastic.org/packages/EQL Computation of the EQL for a given family of variance functions, Saddlepoint-approximations and related auxiliary functions (e.g. Hermite polynomials) * flsa

Re: [R] Urgently needed Exercise solutions related to Practical Data Analysis Using R Statisctial Software

2009-10-04 Thread John Kane
Ah, but the offer of the permanent job with a foreign company is so enticing. BTW I think he says that he is a computer science student. I doubt business school students would be so cheap. --- On Sat, 10/3/09, David Winsemius wrote: > From: David Winsemius > Subject: Re: [R] Urgently needed

Re: [R] update'ing trellis object

2009-10-04 Thread David Winsemius
I wonder if you noticed that you had managed to create a "fig" object that has two "inside" lists by specifying first a key "list" which required a legend list, and then specifying a "legend" list that also had a key function? The solution to your specific request by Kortschak "nulled-out"

Re: [R] Modify base R functions in Rprofile.site

2009-10-04 Thread cls59
Yihui Xie wrote: > > > Thanks a lot, Charlie. What a coincidence -- I'm also working on > Sweave functions. parse() and deparse() can make the code more tidy > (they are used in source() and RweaveLatexRuncode()), > >> RweaveLatex > function () > { > list(setup = RweaveLatexSetup, ru

Re: [R] changing number of axis

2009-10-04 Thread Dan Kortschak
Hi Deepayan, I'm building the pipeline to generate the data, so that can easiy be inserted into the code upstream. Thanks for your help. Dan On Sun, 2009-10-04 at 12:16 -0700, Deepayan Sarkar wrote: > On Thu, Oct 1, 2009 at 11:30 PM, Dan Kortschak > wrote: > > Thanks for that again. That almos

Re: [R] is that possible to graph 4 dimention plot

2009-10-04 Thread milton ruser
How about : google "r graph gallery 4d" ? abs On Sun, Oct 4, 2009 at 3:31 PM, Duncan Murdoch wrote: > On 04/10/2009 3:14 PM, gcheer3 wrote: > >> Suppose there are 4 variables >> d is a function of a , b and c >> I want to know how a, b and c change will make d change >> It will be straightforwa

Re: [R] Modify base R functions in Rprofile.site

2009-10-04 Thread Duncan Murdoch
On 04/10/2009 6:07 PM, Yihui Xie wrote: Thanks a lot, Charlie. What a coincidence -- I'm also working on Sweave functions. parse() and deparse() can make the code more tidy (they are used in source() and RweaveLatexRuncode()), RweaveLatex function () { list(setup = RweaveLatexSetup, runcod

Re: [R] Problem using with panel.average in Lattice package

2009-10-04 Thread Peter Ehlers
Deepayan, Is something similar needed in the last example in ?xyplot? I don't see panel.linejoin producing any lines. Regards, Peter Ehlers Deepayan Sarkar wrote: On Fri, Oct 2, 2009 at 8:03 PM, Mark Dalphin wrote: Hi, I'm having a problem getting the panel.average function to work as I exp

Re: [R] Modify base R functions in Rprofile.site

2009-10-04 Thread Yihui Xie
Thanks a lot, Charlie. What a coincidence -- I'm also working on Sweave functions. parse() and deparse() can make the code more tidy (they are used in source() and RweaveLatexRuncode()), > RweaveLatex function () { list(setup = RweaveLatexSetup, runcode = RweaveLatexRuncode, writedoc =

Re: [R] update'ing trellis object

2009-10-04 Thread Sebastian P. Luque
On Sun, 4 Oct 2009 16:14:58 -0400, Gabor Grothendieck wrote: > On Sun, Oct 4, 2009 at 3:45 PM, Deepayan Sarkar > wrote: > Yes, unfortunately the trellis object cannot distinguish between the >> "legend" and the "key" any more. > If you are willing to muck around at the grid level you can do it

Re: [R] update'ing trellis object

2009-10-04 Thread Gabor Grothendieck
On Sun, Oct 4, 2009 at 3:45 PM, Deepayan Sarkar wrote: > > Yes, unfortunately the trellis object cannot distinguish between the > "legend" and the "key" any more. > If you are willing to muck around at the grid level you can do it. First list out the grid objects using grid.ls(). Now looking for

Re: [R] update'ing trellis object

2009-10-04 Thread Deepayan Sarkar
On Sat, Oct 3, 2009 at 7:35 PM, David Winsemius wrote: > > On Oct 3, 2009, at 7:05 PM, Sebastian P. Luque wrote: > >> Hi, >> >> I thought the following would only remove the legend element of a >> trellis object, but it actually removes both the legend and key >> elements: >> >> ---<--

Re: [R] Problem using with panel.average in Lattice package

2009-10-04 Thread Deepayan Sarkar
On Fri, Oct 2, 2009 at 8:03 PM, Mark Dalphin wrote: > Hi, > > I'm having a problem getting the panel.average function to work as I > expect it to in a lattice plot. I wish to draw lines between the > averages of groups of y-values at specific x-values. I have created a > dataset below which is sim

Re: [R] is that possible to graph 4 dimention plot

2009-10-04 Thread Duncan Murdoch
On 04/10/2009 3:14 PM, gcheer3 wrote: Suppose there are 4 variables d is a function of a , b and c I want to know how a, b and c change will make d change It will be straightforward to see it if we can graph the d surface if d is only a function of a and b, I can use 'persp' to see the surface o

[R] is that possible to graph 4 dimention plot

2009-10-04 Thread gcheer3
Suppose there are 4 variables d is a function of a , b and c I want to know how a, b and c change will make d change It will be straightforward to see it if we can graph the d surface if d is only a function of a and b, I can use 'persp' to see the surface of d. I can easily see at what values of

Re: [R] Row to Column help

2009-10-04 Thread AC Del Re
> > Wonderful, Phil! Your suggestion produced the exact format I desired. > Thank you kindly, > AC Del Re > > > On Sun, Oct 4, 2009 at 2:03 PM, Phil Spector wrote: > >> AC - >> The easiest way I can think of is to create a time variable, >> so reshape will know which observation to call 1, 2

Re: [R] changing number of axis

2009-10-04 Thread Deepayan Sarkar
On Thu, Oct 1, 2009 at 11:30 PM, Dan Kortschak wrote: > Thanks for that again. That almost works, except that lines are drawn > between non-empty bins (in various degrees of diagonality), so absent > points (important here) don't show clearly. It's not a huge issue, so I > might leave it, unless t

Re: [R] Help for 3D Plotting Data on 'Irregular' Grid

2009-10-04 Thread Deepayan Sarkar
On Thu, Oct 1, 2009 at 6:38 AM, Lorenzo Isella wrote: > Dear All, > Here is what I am trying to achieve: I would like to plot some data in 3D. > Usually, one has a matrix of the kind > > y_1(x_1) , y_1(x_2).y_1(x_i) > y_2(x_1) , y_2(x_2).y_2(x_i) > .

Re: [R] Row to Column help

2009-10-04 Thread Phil Spector
AC - The easiest way I can think of is to create a time variable, so reshape will know which observation to call 1, 2, or 3. data$time = unlist(sapply(split(data,data$id),function(x)1:nrow(x))) or data$time = unlist(tapply(data$id,data$id,function(x)1:length(x)) Then reshape(data,idvar=c('id

[R] Row to Column help

2009-10-04 Thread AC Del Re
Dear R Community, I am attempting to transpose a dataset from rows to columns but am stuck. I have tried using reshape() with little luck, possibly due to the categorical nature of the data. For example: id<-c(1,2,2,3,3,3) author<-c("j","k","k","l","l","l") tmt<-c("cbt","act","dbt","act","act","cb

Re: [R] help about solving the equations

2009-10-04 Thread Berend Hasselman
Gabor Grothendieck wrote: > > x is the eigenvector corresponding to eigenvalue 1. See ?eigen. > > Correct. I should have looked better. Berend -- View this message in context: http://www.nabble.com/help-about-solving-the-equations-tp25738073p25740459.html Sent from the R help mailing l

Re: [R] help about solving the equations

2009-10-04 Thread Gabor Grothendieck
x is the eigenvector corresponding to eigenvalue 1. See ?eigen. On Sun, Oct 4, 2009 at 9:31 AM, dahuang wrote: > > i wanna get x from the equations: Ax=x, given A is a matrix. How can i apply > it in R? thanks > -- > View this message in context: > http://www.nabble.com/help-about-solving-the

Re: [R] Modify base R functions in Rprofile.site

2009-10-04 Thread cls59
Duncan Murdoch-2 wrote: > > > Why not just modify their source, and rebuild R? > > Duncan Murdoch > > In my case, the IT guys don't always provide the necessary tools and/or permissions to do this. Which is why we are fortunate that R is so flexible as to allow modification of core routines

Re: [R] extraction from data.frame

2009-10-04 Thread David Winsemius
On Oct 4, 2009, at 12:09 PM, wrote: Hi, I extracted from a data.frame (x) of 27 columns a smaller data.frame (x2) with 12 columns whit the following: x2=x[, c("BROVISINGVal", "CHATVal", "EMAILVal", ..., "Piano.Tariffario")] Something like this (untested): x2=x[ x$Piano.Tariffario == 2

Re: [R] convenience question

2009-10-04 Thread Gabor Grothendieck
Add a flush.console() statement after each cat. On Sun, Oct 4, 2009 at 11:32 AM, Philip A. Viton wrote: > > On: R 2.8.1 / Ms Windows / R-Gui-R-console > > I have a long-ish function, and to re-assure myself that it's actually > making progress I've arranged a set of messages to the console (usin

Re: [R] Modify base R functions in Rprofile.site

2009-10-04 Thread Duncan Murdoch
On 04/10/2009 12:41 PM, cls59 wrote: Yihui Xie wrote: Hi everyone, I want to modify two base R functions 'parse' and 'deparse' immediately after R has started, so I added some code in the file 'Rprofile.site' under the 'etc' directory. Here is a simple example: Why not just modify their sou

Re: [R] Modify base R functions in Rprofile.site

2009-10-04 Thread cls59
Yihui Xie wrote: > > Hi everyone, > > I want to modify two base R functions 'parse' and 'deparse' > immediately after R has started, so I added some code in the file > 'Rprofile.site' under the 'etc' directory. Here is a simple example: > > parse=function(...){ > base::parse(...) > } > >

[R] convenience question

2009-10-04 Thread Philip A. Viton
On: R 2.8.1 / Ms Windows / R-Gui-R-console I have a long-ish function, and to re-assure myself that it's actually making progress I've arranged a set of messages to the console (using cat). But what happens is that the messages don't actually display until the function has finished, which so

[R] help about solving the equations

2009-10-04 Thread dahuang
i wanna get x from the equations: Ax=x, given A is a matrix. How can i apply it in R? thanks -- View this message in context: http://www.nabble.com/help-about-solving-the-equations-tp25738073p25738073.html Sent from the R help mailing list archive at Nabble.com.

[R] extraction from data.frame

2009-10-04 Thread sabrina.michielin
Hi, I extracted from a data.frame (x) of 27 columns a smaller data.frame (x2) with 12 columns whit the following: x2=x[, c("BROVISINGVal", "CHATVal", "EMAILVal", ..., "Piano.Tariffario")] Anyway I want to form x2 by extracting all the rows that assume any value for the first 11 columns but a

Re: [R] Copying matrices with certain probabilities

2009-10-04 Thread David Winsemius
On Oct 4, 2009, at 9:36 AM, William Aue wrote: Hi all! Below is the problem I am struggling with. Let’s say I have a matrix (x) of values: # [,1] [,2] [,3] [,4] #[1,]1321 #[2,]2132 I need to copy the items into a new matrix (y) with certain probability gui

Re: [R] xyplot key

2009-10-04 Thread Deepayan Sarkar
On Wed, Sep 30, 2009 at 6:54 AM, Andrewjohnclose wrote: > > Hi, > > I'm having trouble matching the symbols/color of the key to match those > specifiec in the plot. > > Here is the code I used: > > > xyplot(GCR+GCT ~ FRAC, data=RWF, type=c("g","p"),cex=1.2,pch=c(22,21), > xlab=expression(italic("f

Re: [R] Levelplot without margins

2009-10-04 Thread Deepayan Sarkar
On Mon, Sep 28, 2009 at 9:08 AM, Antje wrote: > I had a bit success with the following usage: > > my.padding <- list(layout.heights = list( >                        top.padding = 0, >                        main.key.padding = 0, >                        key.axis.padding = 0, >                    

Re: [R] help about solving the equations

2009-10-04 Thread Berend Hasselman
dahuang wrote: > > i wanna get x from the equations: Ax=x, given A is a matrix. How can i > apply it in R? thanks > ?solve -- View this message in context: http://www.nabble.com/help-about-solving-the-equations-tp25738073p25738401.html Sent from the R help mailing list archive at Nabble.co

[R] Copying matrices with certain probabilities

2009-10-04 Thread William Aue
Hi all! Below is the problem I am struggling with. Let’s say I have a matrix (x) of values: # [,1] [,2] [,3] [,4] #[1,]    1    3    2    1 #[2,]    2    1    3    2 I need to copy the items into a new matrix (y) with certain probability guidelines. I need to set it up such that: 1. for eac

Re: [R] Access to conditioning variables (lattice)

2009-10-04 Thread Deepayan Sarkar
On Thu, Sep 24, 2009 at 2:14 PM, Martin Lepage wrote: >> The problem I am facing is that I do not know how to generically access >> the conditioning variables within the panel function. In this simple >> case, I can achieve what I want to do with the following call : >> >>    do_something_with(Typ

Re: [R] Numerical.summary Error

2009-10-04 Thread Peter Ehlers
It's probably called summaryStats() now. -Peter Ehlers Rene wrote: Dear all, Have you experienced problem of using numerical.summary() function? I used to be able to run this function in R, but not any more. Now I try to use this function, it gives me error like this: Error: could

Re: [R] add lines() to 1st plot in layout() after calling 2nd plot()?

2009-10-04 Thread Marianne Promberger
baptiste auguie 04-Oct-09 10:32: > dev.new() > layout(matrix(1:4,2, by=T)) > > plot(1:10,main="top left plot") > plot(1:10,main="top right plot") > plot(1:10,main="bottom left plot") > plot(1:10,main="bottom right plot") > > [...] > > par(mfg=c(1,1)) > lines(c(3:7,7:3),col="red") Brilliant! Thank

Re: [R] add lines() to 1st plot in layout() after calling 2nd plot()?

2009-10-04 Thread baptiste auguie
After some checking, I think the documentation is at best misleading on this particular query. Nowhere could I find mention that par(mfg) can work with layout. Instead, I found a warning that suggests incompatibility (since mpg is explicitly tied to mfrow in ?par and layout is said incompatible wit

Re: [R] add lines() to 1st plot in layout() after calling 2nd plot()?

2009-10-04 Thread baptiste auguie
Hi, Try this, dev.new() layout(matrix(1:4,2, by=T)) plot(1:10,main="top left plot") plot(1:10,main="top right plot") plot(1:10,main="bottom left plot") plot(1:10,main="bottom right plot") for (ii in 1:2){ for (jj in 1:2){ par(mfg=c(ii,jj)) text(5,2, lab=paste("plot #:",ii,",",jj,sep="")) } } pa

Re: [R] offlist Re: AW: Urgently needed Exercise solutions related to PracticalData Analysis Using R Statisctial Software

2009-10-04 Thread David Winsemius
On Oct 4, 2009, at 1:42 AM, Daniel Malter wrote: http://www.odesk.com/jobs/College-Assistance_~~dd7622f6bdef9177 He is one very cheeky blighter isn't he? Why would he say he was a student in a "foreign university"? Does he think it will lower the readers' concern for academic malfeasance

Re: [R] add lines() to 1st plot in layout() after calling 2nd plot()?

2009-10-04 Thread Marianne Promberger
Thanks for the quick reply. However ... David Winsemius 03-Oct-09 20:50: MP> layout(matrix(c(1,2),1)) MP> plot(1:10,main="left plot") MP> plot(10:1,main="right plot") MP> lines(c(3:7,7:3),col="red") MP> MP> but of course now lines() gets added to the "right plot". I MP> MP> Is there any way to ma

Re: [R] Paste a character to an object

2009-10-04 Thread David Winsemius
On Oct 4, 2009, at 3:40 AM, Tim Clark wrote: David, Thanks! You just gave me the answer. All I had to do was: xx<-c() for (i in c('100', '75', '50') ) { x<-homerange[[1]]$polygons[[i]] ; xx<-rbind(x,xx) } xx I didn't know you could use characters as index values in a for loop, or that yo

Re: [R] Paste a character to an object

2009-10-04 Thread Tim Clark
David, Thanks! You just gave me the answer. All I had to do was: xx<-c() for (i in c('100', '75', '50') ) { x<-homerange[[1]]$polygons[[i]] ; xx<-rbind(x,xx) } xx I didn't know you could use characters as index values in a for loop, or that you could use characters in double brackets instead