Re: [R] is.category

2008-05-12 Thread Hans W Borchers
Applejus gmail.com> writes: > > > Hello, > > Could someone tell me what the SPLUS "is.category" function do and what is > its equivalent in R? > Thank you, I couldn't find any help elsewhere... > > If you Web search for "splus help" or similar, you will find, among others, http://www.un

Re: [R] Format integer

2008-05-12 Thread Prof Brian Ripley
This is one of those problems where the fine details matter. 1) The version of R. I optimized sprintf() for long inputs and a single format in R 2.7.0 -- the differences are mainly for multiple inputs and where coercion is needed. See also below. 2) The system. My home system with an Intel

[R] R help: problems with step function

2008-05-12 Thread Ping Wang
Dear List Members, I have encountered two problems when using the step function to select models. To better illustrate the problems, attached is an R image which includes the objects needed to run the code attached. lm.data.frame have factor variables with 3 levels. The following run shows the fi

Re: [R] Legend in scatterplot and adding regression lines

2008-05-12 Thread John Fox
Dear Andrew, The scatterplot() function is in the car package, and xyplot() is in the lattice package. The Rcmdr dialog boxes for these functions don't provide for all possible uses, especially in the case of xyplot(). See the help pages ?scatterplot and ?xyplot for more information. With respec

[R] Legend in scatterplot and adding regression lines

2008-05-12 Thread Andrew McFadden
Hi R users The scatterplot (used package R-Cmdr ) obtained has the legend off the plot in the upper left I would like to decide where to put the legend - is that option still available and how do I do it? code: Dataset <- read.table("J:/Pigmatingsb.txt", header=TRUE, sep="\t", na.strings="NA",

Re: [R] help on plot title

2008-05-12 Thread Bert Gunter
Please read the docs (starting with "An Introduction to R") . It is unreasonable to expect to use command line based software without first reading the "how to" manuals. Also, and always, read the man pages: e.g. ?plot, ?plot.default and appropriate links. Finally, as a matter of etiquette, signe

Re: [R] [OT] xemacs on windows vista

2008-05-12 Thread David Scott
Just in case you think Vincent is pushing his distribution as opposed to some other approach, let me endorse his suggestion as someone who has recently made the change to GNU Emacs. Vincent's distribution is truly very nice. I have installed it on Vista without any problems and for anyone wh

Re: [R] help on plot title

2008-05-12 Thread Rolf Turner
title(main=paste("j =",j)) On 13/05/2008, at 9:45 AM, Lisa wrote: Hi, I am do some plotting and need to add title to each of the plots, Can anyone help me on how to add the variables to the title? here it is the program, the title i want should look like, j=1, j=2.., but if i use titl

Re: [R] combining bar and column graphs?

2008-05-12 Thread Me
Michael Kubovy wrote: Perhaps ?mosaic or ?mosaicplot Thanks for these helpful suggestions - I will try them both out - __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-pro

Re: [R] RPM-style install (SLED 10.1)

2008-05-12 Thread Stas Kolenikov
That's what I ended up doing. I've had complaints about blas, too, but I rpm-ed them out with --nodeps. I've compiled R from the sources (I had to add some -devel- packages, too), and then copied over the stats.*.so library from my fully successful 2.6.2 compilation to semi-successful 2.7.0 install

Re: [R] [R-sig-ME] lme nesting/interaction advice

2008-05-12 Thread Rolf Turner
On 13/05/2008, at 4:09 AM, Douglas Bates wrote: I'm entering this discussion late so I may be discussing issues that have already been addressed. As I understand it, Federico, you began by describing a model for data in which two factors have a fixed set of levels and one factor has an extensi

Re: [R] Format integer

2008-05-12 Thread Phil Spector
I guess "little" means different things to different people: x = sample(1:100,65,replace=TRUE) system.time(a<-formatC(x,digits=10,flag='0')) user system elapsed 32.854 0.444 34.813 system.time(b<-sprintf("%011d",x)) user system elapsed 0.352 0.012 0.363 If you look at t

Re: [R] Format integer

2008-05-12 Thread Anh Tran
Yea, thanks all. I checked back and I got a few things mistyped. The array is 650,000 and it took 25 seconds :p. It's acceptable. Just that I had too many variable at the time I ran it. Also, seems like sprintf is a little faster. Thanks all. Anh Tran On Mon, May 12, 2008 at 2:55 PM, Uwe Ligge

Re: [R] Format integer

2008-05-12 Thread Uwe Ligges
Anh Tran wrote: Hi, What's one way to convert an integer to a string with preceding 0's? such that '13' becomes '013' to be put into a string I've tried formatC, but they removes all the zeros and replace it with blanks Not so for me: formatC(13, digits=10, flag="0") Uwe LIgges

Re: [R] Format integer

2008-05-12 Thread Uwe Ligges
Anh Tran wrote: Thanks. formatC(flag) works. But it's awefully slow. I try to do that for 65000 numbers (generating ID for each item) and it seems like forever. On my not that recent laptop: > system.time(formatC(1:65000, width=10, flag="0")) user system elapsed 1.920.001.94

Re: [R] Format integer

2008-05-12 Thread Charilaos Skiadas
On May 12, 2008, at 5:22 PM, Anh Tran wrote: Hi, What's one way to convert an integer to a string with preceding 0's? such that '13' becomes '013' to be put into a string I've tried formatC, but they removes all the zeros and replace it with blanks formatC(13, width=10, format="d", fl

Re: [R] test

2008-05-12 Thread Tony Plate
You probably should check this section in your R-help subscription options (via https://stat.ethz.ch/mailman/options/r-help/, I think): Receive your own posts to the list? Ordinarily, you will get a copy of every message you post to the list. If you don't want to receive this copy, set this o

[R] help on plot title

2008-05-12 Thread Lisa
Hi, I am do some plotting and need to add title to each of the plots, Can anyone help me on how to add the variables to the title? here it is the program, the title i want should look like, j=1, j=2.., but if i use title("j=",j), the j will go to the x axis. Can anyone help me on this? thanka

Re: [R] Format integer

2008-05-12 Thread Anh Tran
Thanks. formatC(flag) works. But it's awefully slow. I try to do that for 65000 numbers (generating ID for each item) and it seems like forever. Is there any faster way? Thank all. Anh Tran On Mon, May 12, 2008 at 2:36 PM, Uwe Ligges < [EMAIL PROTECTED]> wrote: > > > Anh Tran wrote: > > > Hi,

[R] is.category

2008-05-12 Thread Applejus
Hello, Could someone tell me what the SPLUS "is.category" function do and what is its equivalent in R? Thank you, I couldn't find any help elsewhere... -- View this message in context: http://www.nabble.com/is.category-tp1719p1719.html Sent from the R help mailing list archive at Nab

Re: [R] Format integer

2008-05-12 Thread Tony Plate
Try something like one of these (as documented in ?formatC) > formatC(13, flag="0", width=10) [1] "13" > sprintf("%010g", 13) [1] "13" > Anh Tran wrote: Hi, What's one way to convert an integer to a string with preceding 0's? such that '13' becomes '013' to be put into a

[R] Converting qqplot2 qplot() to grammar?

2008-05-12 Thread B. Bogart
Hello all, I've been using the following qplot command: qplot(pixX,pixY, data=som, geom="tile", fill=rgb) + scale_fill_identity() + opts(aspect.ratio = .75) + facet_grid(unitX ~ unitY) Now I would like to convert it into the explicit ggplot grammar, so I can remove the extras: axes, labels, back

[R] Format integer

2008-05-12 Thread Anh Tran
Hi, What's one way to convert an integer to a string with preceding 0's? such that '13' becomes '013' to be put into a string I've tried formatC, but they removes all the zeros and replace it with blanks Thanks -- Regards, Anh Tran [[alternative HTML version deleted]]

Re: [R] help with rpart

2008-05-12 Thread Prof Brian Ripley
Some answers are on the help pages for plot.rpart and text.rpart. On Mon, 12 May 2008, Linus An wrote: Hi, I am using rpart as a part of my masters' project. I am trying to print out the resulting model using plot() function along with text() function. I am having difficulties with labels bein

[R] test

2008-05-12 Thread j t
Sorry to bother your. I am trying to post my question for more than 10 times, but I still didn't see it. It drives my crazy!!! It is a test for posting some simple pure text. Chao __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listin

Re: [R] [OT] xemacs on windows vista

2008-05-12 Thread Esmail Bonakdarian
Wensui Liu wrote: Hi, dear all, I just switch to vista (ultimate) and have heard there is some problem for the installation of xemacs on vista. Is there any insight or experience that you could share? I really appreciate any input. thank you so much! Hi, I don't know about XEmacs, but I am usi

[R] Several questions about MCMClogit

2008-05-12 Thread j t
Hello everybody, I'm new to MCMClogit. I'm trying to use MCMClogit to fit a logistic regression model but I got some warnings I can't understand. My input data X is 32(tissue sample)*20(genes) matrix, each element in this matrix corresponds to the expression value of one particular gene in one o

[R] Several questions about MCMClogit

2008-05-12 Thread j t
Hello everybody, I'm new to MCMClogit. I'm trying to use MCMClogit to fit a logistic regression model but I got some warnings I can't understand. My input data X is 32(tissue sample)*20(genes) matrix, each element in this matrix corresponds to the expression value of one particular gene in one o

[R] Several questions about MCMClogit

2008-05-12 Thread j t
Hello everybody, I'm new to MCMClogit. I'm trying to use MCMClogit to fit a logistic regression model but I got some warnings I can't understand. My input data X is 32(tissue sample)*20(genes) matrix, each element in this matrix corresponds to the expression value of one particular gene in one o

[R] Converting qqplot2 qplot() to grammar?

2008-05-12 Thread B. Bogart
Hello all, I've been using the following qplot command: qplot(pixX,pixY, data=som, geom="tile", fill=rgb) + scale_fill_identity() + opts(aspect.ratio = .75) + facet_grid(unitX ~ unitY) Now I would like to convert it into the explicit ggplot grammar, so I can remove the extras: axes, labels, back

[R] Several questions about MCMClogit

2008-05-12 Thread j t
Hello everybody, I'm new to MCMClogit. I'm trying to use MCMClogit to fit a logistic regression model but I got some warnings I can't understand. My input data X is 32(tissue sample)*20(genes) matrix, each element in this matrix corresponds to the expression value of one particular gene in one o

Re: [R] RPM-style install (SLED 10.1)

2008-05-12 Thread Horace Tso
Stas, this doesn't solve your problem but may shed some light on what might have gone wrong. Just recently I installed R 2.7.0 under openSuse 10.3 in a brand new 64-bit Lenovo ThinkPad. The first install failed because of a dependency error just like yours. It complained it couldn't find BLAS an

Re: [R] writing a table in the device (pdf in this case)

2008-05-12 Thread Greg Snow
You probably want to look at "Sweave" in the "utils" package or the "odfWeave" package. Both let you set up a planned set of commands interspersed with text (notes, explanations, full report, etc.) and then you process the file and get the output (and commands) in either a LaTeX file or an Open

[R] help with rpart

2008-05-12 Thread Linus An
Hi, I am using rpart as a part of my masters' project. I am trying to print out the resulting model using plot() function along with text() function. I am having difficulties with labels being cut-off. In text() function, I am using use.n=T option to get the number of people in each nodes but the

[R] Several questions about MCMClogit

2008-05-12 Thread j t
Hello everybody, I'm new to MCMClogit. I'm trying to use MCMClogit to fit a logistic regression model but I got some warnings I can't understand. My input data X is 32(tissue sample)*20(genes) matrix, each element in this matrix corresponds to the expression value of one particular gene in o

Re: [R] [OT] xemacs on windows vista

2008-05-12 Thread Vincent Goulet
Le lun. 12 mai à 15:15, Wensui Liu a écrit : Hi, dear all, I just switch to vista (ultimate) and have heard there is some problem for the installation of xemacs on vista. Is there any insight or experience that you could share? Yes: go with GNU Emacs. There doesn't seem to be any compelling re

Re: [R] Left censored responses in mixed effects models

2008-05-12 Thread Gregor Gorjanc
Bert Gunter gene.com> writes: > Dear R Fellow-Travellers: > > What is your recommended way of dealing with a left-censored response > (non-detects) in (linear Gaussian) mixed effects models? Your description of the data calls for a tobit model http://en.wikipedia.org/wiki/Tobit_model I think y

Re: [R] lexicographic comparison of two vectors

2008-05-12 Thread Duncan Murdoch
On 5/12/2008 2:58 PM, Gabriel Valiente wrote: Is there any built-in way to lexicographically compare two vectors of the same length in R? The textbook algorithm could be coded as follows: lex.cmp <- function (vec1,vec2) { for (j in 1:length(vec1)) { if (vec1[j] < vec2[j]) { return(-1)

[R] [OT] xemacs on windows vista

2008-05-12 Thread Wensui Liu
Hi, dear all, I just switch to vista (ultimate) and have heard there is some problem for the installation of xemacs on vista. Is there any insight or experience that you could share? I really appreciate any input. thank you so much! __ R-help@r-project.o

[R] lexicographic comparison of two vectors

2008-05-12 Thread Gabriel Valiente
Is there any built-in way to lexicographically compare two vectors of the same length in R? The textbook algorithm could be coded as follows: lex.cmp <- function (vec1,vec2) { for (j in 1:length(vec1)) { if (vec1[j] < vec2[j]) { return(-1) } if (vec1[j] > vec2[j]) { return(1) } }

Re: [R] Left censored responses in mixed effects models

2008-05-12 Thread Don MacQueen
I assume you've looked at the NADA package(?) While I don't believe it goes as far as dealing the mixed effects models, it might give you a starting point, and possibly some additional references. -Don At 9:08 AM -0700 5/12/08, Bert Gunter wrote: Dear R Fellow-Travellers: What is your recomm

Re: [R] how to not sort factors when plotting

2008-05-12 Thread Lydia N. Slobodian
Thanks for all of the help! Everything's working beautifully now, and I've accomplished in a few hours what it takes most of my colleagues weeks to do, so I think I'll stick with R after all! Lydia On Mon, May 12, 2008 at 4:41 PM, Jorge Ivan Velez <[EMAIL PROTECTED]> wrote: > > > Hi Lydia, > > I

Re: [R] Compact Indicator Matrices

2008-05-12 Thread amarkos
Thanks. It works! I think I found another solution, working straight with the indicator matrix. > count <- factor(table(apply(ind, 1, paste, collapse=""))) However, that way I can't store the indices of the collapsed rows. -Angelos Markos __ R-help@r

Re: [R] Limiting size of pairs plots

2008-05-12 Thread Sébastien
Dear R-users, This is a follow-up on a quite old post of mine which dealt with margins in the pairs function. I thought my problem was solved, but it doesn't seem so (see the code below). I use the pairs function to produce matrix plots, where distinct groups are represented by dots of diffe

[R] what kind of residuals are the ones calculated in coxph?

2008-05-12 Thread Chang Liu
Hi Gurus: In the coxph() objects in Survival package, there is an attribute called residuals. Usually, there are several kinds for censored survival data. I can't seem to find in the documentation as to which one this is calculating. Anyone knows? Karen _

Re: [R] predicting from coxph with pspline

2008-05-12 Thread Terry Therneau
-== begin included message - Hello. I get a bit confused by the output from the predict function when used on an object from coxph in combination with p-spline, e.g. fit <- coxph(Surv(time1, time2, status)~pspline(x), Data) predict(fit, newdata=data.frame(x=1:2)) - end include

Re: [R] how to check linearity in Cox regression

2008-05-12 Thread Terry Therneau
Use pspline within a Cox model. It includes a fairly general test for nonlinearity, that is similar to GAM models. Terry Therneau > coxph(Surv(time, status) ~ ph.ecog + pspline(age), lung) Call: coxph(formula = Surv(time, status) ~ ph.ecog + pspline(age), data = lung)

Re: [R] [R-sig-ME] lme nesting/interaction advice

2008-05-12 Thread Douglas Bates
On Mon, May 12, 2008 at 11:22 AM, Federico Calboli <[EMAIL PROTECTED]> wrote: > On 12 May 2008, at 17:09, Douglas Bates wrote: > >> I'm entering this discussion late so I may be discussing issues that >> have already been addressed. >> >> As I understand it, Federico, you began by describing a mode

Re: [R] Monty Hall simulation

2008-05-12 Thread Farley, Robert
The common "Monty Hall" problem (where the MC helps out the contestant) is not random! See: http://en.wikipedia.org/wiki/Monty_Hall_problem My edits were removed as I had no references. :-( Maybe you can verify my statements, included below. :-) Another analysis considers three types of h

[R] hessian in constrained optimization (constrOptim)

2008-05-12 Thread Carlo Fezzi
Dear helpers, I am using the function "constrOptim" to estimate a model with ML with an inequality constraint using the option method='Nelder-Mead'. When I specify the option: hessian = TRUE I obtain the response: Error in f(theta, ...) : unused argument(s) (hessian = TRUE) I guess the function

Re: [R] Compact Indicator Matrices

2008-05-12 Thread Douglas Bates
On Mon, May 12, 2008 at 11:27 AM, amarkos <[EMAIL PROTECTED]> wrote: > Thanks, it works! > Could you please provide the direct method you mentioned for the > multivariate case? I'm not sure what you mean. I looked at what I wrote and I don't see anything that would fit that description. May I s

Re: [R] how to not sort factors when plotting

2008-05-12 Thread Gavin Simpson
On Mon, 2008-05-12 at 11:41 -0400, Jorge Ivan Velez wrote: > Hi Lydia, [I'm struggling to see what this has to do with the subject line?] > > I compared my ratio function with Dimitris and Phil's suggestions. Please do > NOT use my approach because it's painfully slow for a large vector (as Phil

Re: [R] Fonts in Quartz Devices

2008-05-12 Thread Arcadio Rubio García
El 12/05/2008, a las 18:18, Prof Brian Ripley escribió: On Mon, 12 May 2008, Arcadio Rubio García wrote: Hi, I'm new to R. I'm using a Mac OS X 10.5 and R 2.7.0. I'm trying to change the font family for a plot in a quartz device. Simply passing the desired font by using the family argume

Re: [R] [R-sig-ME] lme nesting/interaction advice

2008-05-12 Thread Federico Calboli
On 12 May 2008, at 17:09, Douglas Bates wrote: I'm entering this discussion late so I may be discussing issues that have already been addressed. As I understand it, Federico, you began by describing a model for data in which two factors have a fixed set of levels and one factor has an extensibl

Re: [R] Fonts in Quartz Devices

2008-05-12 Thread Prof Brian Ripley
On Mon, 12 May 2008, Arcadio Rubio García wrote: Hi, I'm new to R. I'm using a Mac OS X 10.5 and R 2.7.0. I'm trying to change the font family for a plot in a quartz device. Simply passing the desired font by using the family argument works with other devices, but not with quartz. Am I miss

Re: [R] Mathematical annotation in lattice strip: Is it possible?

2008-05-12 Thread Deepayan Sarkar
On 5/12/08, Andrewjohnclose <[EMAIL PROTECTED]> wrote: > > I have tried without success to find a way including the square root symbol > in lattice strips as part of my conditioning labels. I have tried > supplementing by creating a list of vectors using the var.name function > coupled with the

Re: [R] [R-sig-ME] lme nesting/interaction advice

2008-05-12 Thread Douglas Bates
I'm entering this discussion late so I may be discussing issues that have already been addressed. As I understand it, Federico, you began by describing a model for data in which two factors have a fixed set of levels and one factor has an extensible, or "random", set of levels and you wanted to fi

Re: [R] Fundamental formula and dataframe question.

2008-05-12 Thread Greg Snow
I would have thought that: > lm( C1 ~ M^2, data=DF ) Would give the main effects and 2 way interaction(s) (but a quick test did not match my expectation). Possibly a feature request is in order if people plan to use this a lot. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermou

[R] Left censored responses in mixed effects models

2008-05-12 Thread Bert Gunter
Dear R Fellow-Travellers: What is your recommended way of dealing with a left-censored response (non-detects) in (linear Gaussian) mixed effects models? Specifics: Response is a numeric positive measurement (of volume, actually); but when it falls below some unknown and slightly random value (dep

Re: [R] Random number generation

2008-05-12 Thread Greg Snow
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Esmail Bonakdarian > Sent: Sunday, May 11, 2008 7:25 AM > To: Prof Brian Ripley > Cc: [EMAIL PROTECTED] > Subject: Re: [R] Random number generation [snip] > What I read doesn't seem to be incorrect ho

Re: [R] inserting mathematical symbols in lattice strip

2008-05-12 Thread Richard . Cotton
> I have tried without success to find a way including the square root symbol > in lattice strips as part of my conditioning labels. I have tried > supplementing by creating a list of vectors using the var.name function > coupled with the expression function used in xlab/ylab. > > xyplot(adjuste

Re: [R] how to not sort factors when plotting

2008-05-12 Thread Jorge Ivan Velez
Hi Lydia, I compared my ratio function with Dimitris and Phil's suggestions. Please do NOT use my approach because it's painfully slow for a large vector (as Phil told me). Here is why (using Win XP SP2, Intel Core- 2 Duo 2.4 GHz, R 2.7.0 Patched): # Vector x=rnorm(10,0,1) # Suggestion new.

Re: [R] ggplot2: font size mismatch for pdf output

2008-05-12 Thread hadley wickham
> More generally, how do I control the size of fonts used in legends > and axis labels? There is no general way (yet) - it is on my customisation to do list, which I hope to make progress on over summer. Hadley -- http://had.co.nz/ __ R-help@r-projec

Re: [R] how to not sort factors when plotting

2008-05-12 Thread Dimitris Rizopoulos
this can be more efficiently coded using indexing, e.g., x <- c(1,2,3,2,1,2,3) n <- length(x) x[2:n] / x[1:(n-1)] Best, Dimitris Dimitris Rizopoulos Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336

Re: [R] Fonts in Quartz Devices

2008-05-12 Thread Arcadio Rubio García
In relation to my previous email, I've discovered that quartz(family = "Monaco") works fine with 2.6.2. However, it doesn't with 2.7.0. Moreover, with 2.6.2 I get lot's of warnings, that previously I didn't. Maybe an update of the OS has broken some code leading to a bug? El 12/05/2008, a l

Re: [R] how to not sort factors when plotting

2008-05-12 Thread Jorge Ivan Velez
Hi Lydia, Try this: # Function ratio=function(x){ temp=NULL for (n in 1:length(x)) temp=c(temp,x[n]/x[n-1]) temp } # Example x=c(1,2,3,2,1,2,3) ratio(x) [1] 2.000 1.500 0.667 0.500 2.000 1.500 HTH, Jorge On Mon, May 12, 2008 at 9:52 AM, Lydia N. Slobodian <[EMAIL PR

Re: [R] ggplot2: font size mismatch for pdf output

2008-05-12 Thread Michael Friendly
Sorry for not providing this in my initial posting. I'm using R version 2.7.0 (2008-04-22), on Win XP Pro. As I said, the .png output matched what I saw on screen. It was the .pdf output for which the font size was noticeably larger, enough to make the legend run off the screen. -Michael Prof B

Re: [R] help with calculating the differences between dates

2008-05-12 Thread Uwe Ligges
Tom Cohen wrote: Dear list, How can I calculate the difference in days between the eventdate and basedate in the below dataset? id basedate outcome.3 eventdate daydiff 1 1001 1999-09-28 2 1999-10-013 2 1002 1999-09-22 1 3 1003 2000-01-19

[R] Fonts in Quartz Devices

2008-05-12 Thread Arcadio Rubio García
Hi, I'm new to R. I'm using a Mac OS X 10.5 and R 2.7.0. I'm trying to change the font family for a plot in a quartz device. Simply passing the desired font by using the family argument works with other devices, but not with quartz. Am I missing anything? I've already checked the docs for

Re: [R] ggplot2: font size mismatch for pdf output

2008-05-12 Thread Prof Brian Ripley
What version of R and OS is this? Prior to R 2.7.0 there was little attempt to match output dimensions from various devices, and one of the png devices in 2.7.0 has an error in doing so, fixed in R-patched (see NEWS). On Mon, 12 May 2008, Michael Friendly wrote: Hi In the following, the gr

[R] inserting mathematical symbols in lattice strip

2008-05-12 Thread Andrewjohnclose
I have tried without success to find a way including the square root symbol in lattice strips as part of my conditioning labels. I have tried supplementing by creating a list of vectors using the var.name function coupled with the expression function used in xlab/ylab. xyplot(adjusted_Rand_index

[R] help with calculating the differences between dates

2008-05-12 Thread Tom Cohen
Dear list, How can I calculate the difference in days between the eventdate and basedate in the below dataset? id basedate outcome.3 eventdate daydiff 1 1001 1999-09-28 2 1999-10-013 2 1002 1999-09-22 1 3 1003 2000-01-19 1 4

[R] RPM-style install (SLED 10.1)

2008-05-12 Thread Stas Kolenikov
I am trying to install R on a SLED 10.1 machine. R-base-2.7.0-7.1-i586.rpm fails with [EMAIL PROTECTED]:~/RPMs> rpm -Uvh R-base-2.7.0-7.1.i586.rpm warning: R-base-2.7.0-7.1.i586.rpm: Header V3 DSA signature: NOKEY, key ID 14ec5930 error: Failed dependencies: libgfortran.so.1 is needed by R

Re: [R] rpart with circular data?

2008-05-12 Thread Dylan Beaudette
On Mon, May 12, 2008 at 6:29 AM, Bálint Czúcz <[EMAIL PROTECTED]> wrote: > Hi Rainer, > > In a similar situation I used the two components of the normal vector > of the surface ("northing" & "easting"). I.e. for a horizontal plane > both are 0, for a vertical slope facing south northing=-1and > eas

Re: [R] [R-sig-ME] lme nesting/interaction advice

2008-05-12 Thread Federico Calboli
On 12 May 2008, at 14:37, Doran, Harold wrote: I haven't followed this thread carefully, so apologies if I'm too off base. But, in response to Rolf's questions/issues. First, SAS cannot handle models with crossed random effects (at least well at all). SAS is horribly incapable of handling eve

Re: [R] [R-sig-ME] lme nesting/interaction advice

2008-05-12 Thread Federico Calboli
On 12 May 2008, at 12:21, Nick Isaac wrote: I *think* the syntax for the model Federico wants is this: lmer(y~selection*males+ (selection|month) + (males|month)) I'll try and check against some back of the envelope calculations -- as I said, the model is, per se, nothing really new, and my

[R] ggplot2: font size mismatch for pdf output

2008-05-12 Thread Michael Friendly
Hi In the following, the graph I see on the screen and the .png output coincide. However, in the .pdf file, the fonts seem to be scaled fairly larger, resulting in the label for the top legend disappearing. Is this an infelicity or bug, or is there something I've missed? More generally, how do

Re: [R] Collection of lm()s

2008-05-12 Thread Dimitris Rizopoulos
try something like the following: x <- runif(1000, -3, 3) y <- 2 + 3 * x + rnorm(1000) f <- gl(10, 100) lm.lis <- vector("list", 10) for (i in 1:10) { lm.lis[[i]] <- lm(y ~ x, subset = f == as.character(i)) } sapply(lm.lis, coef) sapply(lm.lis, fitted) I hope it helps. Best, Dimitris --

Re: [R] Collection of lm()s

2008-05-12 Thread Prof Brian Ripley
On Mon, 12 May 2008, Chip Barnaby wrote: Hello, I would like to create a subscriptable collection (presumably a list) of lm() models. I have a data frame DX containing 6 groups of data. The general idea is (NOT RUN) ... for (i in 1:6) { DXS = subset( DX, ); LMX[ i] = lm( , d

Re: [R] how to not sort factors when plotting

2008-05-12 Thread Lydia N. Slobodian
Hello. I'm trying find the ratios between each of the integers in a vector. I have: for (n in x) { ratio <- (x[n]/x[n-1]) ratio.all <- c(ratio.all, ratio) } Of course this doesn't work, nor does diff(n)/diff(n-1). Is there a way to specify a pair of integers in a vector? Thank you, Lyd

[R] Mathematical annotation in lattice strip: Is it possible?

2008-05-12 Thread Andrewjohnclose
I have tried without success to find a way including the square root symbol in lattice strips as part of my conditioning labels. I have tried supplementing by creating a list of vectors using the var.name function coupled with the expression function used in xlab/ylab. xyplot(adjusted_Rand_index~

Re: [R] combining bar and column graphs?

2008-05-12 Thread Michael Kubovy
Perhaps ?mosaic or ?mosaicplot _ Professor Michael Kubovy University of Virginia Department of Psychology USPS: P.O.Box 400400Charlottesville, VA 22904-4400 Parcels:Room 102Gilmer Hall McCormick RoadCharlottesville, VA 22903 Office:B0

[R] Collection of lm()s

2008-05-12 Thread Chip Barnaby
Hello, I would like to create a subscriptable collection (presumably a list) of lm() models. I have a data frame DX containing 6 groups of data. The general idea is (NOT RUN) ... for (i in 1:6) { DXS = subset( DX, ); LMX[ i] = lm( , data = DXS); } Now access model results by

Re: [R] [R-sig-ME] lme nesting/interaction advice

2008-05-12 Thread Doran, Harold
> But that avoids the question as to *why* it isn't very well > set up for crossed random effects? What's the problem? > What are the issues? The model is indeed bog-standard. > It would seem not unreasonable to expect that it could be > fitted in a straightforward m

Re: [R] Compact Indicator Matrices

2008-05-12 Thread Douglas Bates
On Sun, May 11, 2008 at 9:49 AM, amarkos <[EMAIL PROTECTED]> wrote: > On May 11, 4:47 pm, "Douglas Bates" <[EMAIL PROTECTED]> wrote: > >> Do you mean that you want to collapse similar rows into a single row >> and perhaps a count of the number of times that this row occurs? > > Let me rephrase the

Re: [R] rpart with circular data?

2008-05-12 Thread Bálint Czúcz
Hi Rainer, In a similar situation I used the two components of the normal vector of the surface ("northing" & "easting"). I.e. for a horizontal plane both are 0, for a vertical slope facing south northing=-1and easting=0, etc. This descartian decomposition of the slope vector avoids the problem of

[R] Optimization problem, to minimize the length(rle(B)$lengths) for all the rows and columns

2008-05-12 Thread Ng Stanley
Hi, how can I order the rows and columns of a matrix A to generate B, in order to minimize the length(rle(B)$lengths) for all the rows and columns ? > set.seed(5) > a <- matrix(rnorm(200), nrow=20) > a[a<=0] <- 0 > a[a>0] <- 1 > a [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,]

Re: [R] [R-sig-ME] lme nesting/interaction advice

2008-05-12 Thread Nick Isaac
I *think* the syntax for the model Federico wants is this: lmer(y~selection*males+ (selection|month) + (males|month)) My lme syntax is a bit rusty, so I'm not confident how to recode with nested random effects, as in P&B p24. Two quick points: 1. I think Federico has caused some confusion on ac

Re: [R] Insert a recorde into a table using SQL

2008-05-12 Thread ronggui
It works. Thanks very much. Best On Mon, May 12, 2008 at 7:02 PM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > Create an encoding function which replaces single quotes with > two single quotes: > > # first string is a single character consisting of single quote > # second string is two charact

Re: [R] Quadratic Constraints

2008-05-12 Thread Shubha Vishwanath Karanth
Hello R, By any chance, Rdonlp2 package of R defined in http://arumat.net/Rdonlp2/tutorial.html#SECTION0002 serves the below purpose? BR, Shubha -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shubha Vishwanath Karanth Sent: Monday, May 12

Re: [R] Insert a recorde into a table using SQL

2008-05-12 Thread Gabor Grothendieck
Create an encoding function which replaces single quotes with two single quotes: # first string is a single character consisting of single quote # second string is two characters consisting of two single quotes enc <- function(x) gsub("'", "''", x) dbGetQuery(con,sprintf("insert into dd (txt) valu

Re: [R] lme nesting/interaction advice

2008-05-12 Thread Federico Calboli
On 12 May 2008, at 11:16, Andrew Robinson wrote: Well. I have documentation relevant to nlme that goes back about 10 years. I don't know when it was first added to S-plus, but I assume that it was about then. Now, do you think that if the thing that you want to do was really bog standard, that

Re: [R] lme nesting/interaction advice

2008-05-12 Thread Andrew Robinson
On Mon, May 12, 2008 at 10:50:03AM +0100, Federico Calboli wrote: > > On 12 May 2008, at 01:05, Andrew Robinson wrote: > > >On Mon, May 12, 2008 at 10:34:40AM +1200, Rolf Turner wrote: > >> > >>On 12/05/2008, at 9:45 AM, Andrew Robinson wrote: > >> > >>>On Sun, May 11, 2008 at 07:52:50PM +0100, F

Re: [R] [R-sig-ME] lme nesting/interaction advice

2008-05-12 Thread Federico Calboli
On 12 May 2008, at 10:05, Ken Beath wrote: There is only one random effect, so where does the crossing come from ? The fixed effects vary across blocks, but they are fixed so are just covariates. For this type of data the usual model in lme4 is y~fixed1+fixed2+1|group and for lme split into

[R] Quadratic Constraints

2008-05-12 Thread Shubha Vishwanath Karanth
Hi R, A quick question How can I optimize the objective function constrained to quadratic constraints? Which function of R is useful for quadratic constraints? Many Thanks, Shubha This e-mail may contain confidential and/or privileged i...{{dropped:13}} ___

Re: [R] mgcv::gam shrinkage of smooths

2008-05-12 Thread Simon Wood
On Tuesday 06 May 2008 23:34, David Katz wrote: > In Dr. Wood's book on GAM, he suggests in section 4.1.6 that it might be > useful to shrink a single smooth by adding S=S+epsilon*I to the penalty > matrix S. The context was the need to be able to shrink the term to zero if > appropriate. I'd like

Re: [R] lme nesting/interaction advice

2008-05-12 Thread Federico Calboli
On 12 May 2008, at 01:05, Andrew Robinson wrote: On Mon, May 12, 2008 at 10:34:40AM +1200, Rolf Turner wrote: On 12/05/2008, at 9:45 AM, Andrew Robinson wrote: On Sun, May 11, 2008 at 07:52:50PM +0100, Federico Calboli wrote: The main point of my question is, having a 3 way anova (or an

Re: [R] lme nesting/interaction advice

2008-05-12 Thread Federico Calboli
On 11 May 2008, at 23:34, Rolf Turner wrote: It doesn't seem to me to be a complaint as such. It is a request for insight. I too would like some insight as to what on earth is going on. And why do you say Federico shows no evidence of having searched the archiv

Re: [R] lme nesting/interaction advice

2008-05-12 Thread Federico Calboli
On 12 May 2008, at 09:29, Dieter Menne wrote: Federico: First, mixed models are different from "standard 101 Anova", and quite a lot of the nesting stuff I used to ponder about 30 year ago when I started teaching this is no longer relevant and works implicitely when you code the parameter

Re: [R] Cumulative lattice histograms

2008-05-12 Thread Dieter Menne
Ola Caster gmail.com> writes: > It's fairly straightforward to plot cumulative histograms using the hist() > function. You do something like: > > h <- hist(rnorm(100), plot=FALSE) > h$counts<- cumsum(h$counts) > plot(h) > > However, I have failed to find any example where this is done using the

  1   2   >