[R] ggplot2: mapping categorical variable to color aesthetic with faceting

2009-10-06 Thread Bryan Hanson
"set" the colors: Do I compute the length of all possible combos of A, B with lrg, sm, and then create one long vector of colors for the entire plot? I tried something like this, and was not successful, but perhaps could be with more work. All advice appreciated, Bryan (session info

Re: [R] ggplot2: proper use of facet_grid inside a function

2009-10-05 Thread Bryan Hanson
o perform a post-mortem examination: he may be able to > say what the experiment died of. > ~ Sir Ronald Aylmer Fisher > > The plural of anecdote is not data. > ~ Roger Brinner > > The combination of some data and an aching desire for an answer does not > ensure that a

[R] ggplot2: proper use of facet_grid inside a function

2009-10-02 Thread Bryan Hanson
nnet_7.2-48mclust_3.2 MASS_7.2-48 [21] lars_0.9-7 e1071_1.5-19 class_7.2-48 loaded via a namespace (and not attached): [1] cluster_1.12.0 Thanks for any help! Bryan ***** Bryan Hanson Professor of Chemistry & Biochemistry DePauw University,

Re: [R] Teasing out logrank differences *between* groups using survdiff or something else?

2009-09-15 Thread Bryan Hanson
ore hazardous than T1 vs WISO If in fact it is true? Maybe the answer is already in our output, in the sense that the CI's don't overlap much? Maybe we are wrong to seek a p value as well? Thanks again, Bryan * Bryan Hanson Professor of Chemistry & Biochemistry DePauw U

[R] Teasing out logrank differences *between* groups using survdiff or something else?

2009-09-15 Thread Bryan Hanson
don't quite see it and wouldn't trust ourselves anyway, given the special nature of survival analysis. Manual instructions or a function suggestion would be great. Thanks in Advance, Bryan * Bryan Hanson Professor of Chemistry & Biochemistry

Re: [R] xyplot {lattice} are different types possible for each panel?

2009-09-07 Thread Bryan Hanson
  panel.xyplot(...,type = "h") >           } else { >          panel.xyplot(...,type = type) >          } >        }) > > plot(p) > > HTH, > > baptiste > > 2009/9/7 Bryan Hanson >> Hello R Folks... >> >

[R] xyplot {lattice} are different types possible for each panel?

2009-09-07 Thread Bryan Hanson
, Bryan * Bryan Hanson Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA y <- rnorm(100) x <- rnorm(100) names <- rep(c("Set 1", "Set 2", "Set 3"), 4) df <- data.frame(y = y, x = y, names = as.factor(names))

Re: [R] Matrix as input to xyplot {lattice} - proper extended formula syntax

2009-09-05 Thread Bryan Hanson
k. Presumably you have > assigned off-stage the value of title to a meaningful character string? > >> p <- xyplot(y.1+y.2+y.3+y.4 ~ x |1:4, data = df, main = > "title" ,layout=c(1,4) ) >> p > > > > > On Sep 5, 2009, at 11:52 PM, Bryan Hanson w

[R] Matrix as input to xyplot {lattice} - proper extended formula syntax

2009-09-05 Thread Bryan Hanson
his, or at least I don¹t recognize it if I have! Is there a more elegant way to tell xyplot I want to use each row of y repeatedly with the same x, in a loop-like fashion? TIA. Bryan ********* Bryan Hanson Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA

Re: [R] Google's R Style Guide (has become S3 vs S4, in part)

2009-09-01 Thread Bryan Hanson
d made Myobject an S4 object, then I would have to go back, redefine the object, update validObject, and possibly write some new accessor and definitely constructor functions. At least, that's how I understand the way one uses S4 classes. Back to trying to get something done! Bryan **

Re: [R] Lattice in a loop does not produce output

2009-08-18 Thread Bryan Hanson
Lattice objects must be assigned and deliberately printed: > png("test.png") > p <- xyplot(y~x|z) > plot(p) > dev.off() Should fix both problems. Bryan * Bryan Hanson Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA On 8

Re: [R] Selecting/Accessing the last vector in a list of a list of data.frames

2009-08-11 Thread Bryan Hanson
0972 -0.000961 -0.000946 .. ..$ c : num NA ..$ r : num NA On 8/11/09 7:28 PM, "Henrique Dallazuanna" wrote: > If I understand correctly your question, you can try something about like > this: > > # Access all elements named 'V1' in your list > lapply(te

[R] Selecting/Accessing the last vector in a list of a list of data.frames

2009-08-11 Thread Bryan Hanson
simple approach, but I may be too tired right now to see it! Thanks, Bryan * Bryan Hanson Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/l

[R] Need Advice: Considering Converting a Package from S3 to S4

2009-08-10 Thread Bryan Hanson
t; as they say. If methods are not critical, does it make sense to spend the time making the change? Any perspective and advice would be welcomed. Thanks in advance, Bryan * Bryan Hanson Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA

Re: [R] str(data.frame) after subsetting reflects original structure, not subsetted structure?

2009-07-24 Thread Bryan Hanson
Thanks Marc and Ben... Your answers were most helpful. I suspected something had been written about it, but was having trouble formulating a reasonable search query. I was looking in the help page for str(), which was sort of a dead end. Bryan * Bryan Hanson Professor of Chemistry

[R] str(data.frame) after subsetting reflects original structure, not subsetted structure?

2009-07-24 Thread Bryan Hanson
() a lot to check my work, and in this case, it seems to have misled me. Thanks as always, Bryan * Bryan Hanson Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA __ R-help@r-project.org mailing list https:

[R] panel.lmline - are m, b, and r^2 accessible somehow?

2009-07-22 Thread Bryan Hanson
done manually within panel.groups ( http://www.nabble.com/add-trend-line-to-each-group-of-data-in%3A-xyplot(y1%2 By2-~-x-|-grp...-td3344023.html#a3382909) but that was a few versions back. Other suggestions? Thanks, Bryan * Bryan Hanson Professor of Chemistry & Biochemistry De

[R] Managing Packages: Which functions call other functions in package?

2009-07-01 Thread Bryan Hanson
might provide; maybe that¹s where I should be looking? Does such a thing exist? Thanks, Bryan * Bryan Hanson Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA [[alternative HTML version deleted]] __ R-

Re: [R] How do I define the method for gcheckboxgroup in gWidgets?

2009-06-27 Thread Bryan Hanson
On 6/27/09 8:25 AM, "Michael Lawrence" wrote: > > > On Thu, Jun 25, 2009 at 8:29 AM, Bryan Hanson wrote: >> Hi All... >> >> I¹m trying to build a small demo using gWidgets which permits interactive >> scaling and selection among different things to plo

[R] How do I define the method for gcheckboxgroup in gWidgets?

2009-06-25 Thread Bryan Hanson
. For the sliders, it's clear to me how the actions and drawing of the widgets differ, but not so for gcheckboxgroup. A big TIA, Bryan * Bryan Hanson Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA Full Script: x <- 1:10 y1 <- x y2 <- x^2 y3 &

Re: [R] Questíon regarding the use of write.csv2 , write.table ...

2009-06-18 Thread Bryan Hanson
Write.table will give you all the control you need to get exactly what you want. Bryan On 6/18/09 7:50 AM, "xavier.char...@free.fr" wrote: > Hi, It sounds like the first column that is "added" is actually the row > names. That's why a previous answer pointed this argumented. Default for > wri

Re: [R] R in the NY Times

2009-01-07 Thread Bryan Hanson
later when a software problem in the designing of the engine makes your plane fall out of the sky! Bryan * Bryan Hanson Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA >> ³I think it addresses a niche market for high-end data analysts that >&

Re: [R] Are there any guis out there, which will allow editing of the graph?

2008-08-04 Thread Bryan Hanson
this was possible on some R code that went with a Wikipedia entry, and he tried it, and it works. YMMV. Bryan * Bryan Hanson Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA On 8/4/08 1:09 PM, "Bert Gunter" <[EMAIL PROTECTED]> wr

Re: [R] Properly Parsing Pre-Superscripts & Displaying Them With grid.text

2008-08-02 Thread Bryan Hanson
PROTECTED]> wrote: > On Fri, 2008-08-01 at 17:23 -0400, Bryan Hanson wrote: >> Hi all... I¹m making a chart dealing with frequencies of isotopes of various >> elements. For instance, I'd like the following text to appear on a chart >> with the "35" and &

[R] Properly Parsing Pre-Superscripts & Displaying Them With grid.text

2008-08-01 Thread Bryan Hanson
Hi all... I¹m making a chart dealing with frequencies of isotopes of various elements. For instance, I'd like the following text to appear on a chart with the "35" and "37" as superscripts: Based upon: 35Cl: 75% 37Cl: 25% I am having problems properly parsing the superscript that preceeds the "C

Re: [R] Lattice Version of grconvertX or variant on panel.text?

2008-07-20 Thread Bryan Hanson
Never mind, I just hard-coded it using ratios. Simpler than I thought. Thanks, Bryan On 7/20/08 9:03 PM, "Bryan Hanson" <[EMAIL PROTECTED]> wrote: > Still playing with Lattice... > > I want to use panel.text(x, y etc) but with x and y in plot coordinates > (0,1),

[R] Lattice Version of grconvertX or variant on panel.text?

2008-07-20 Thread Bryan Hanson
Still playing with Lattice... I want to use panel.text(x, y etc) but with x and y in plot coordinates (0,1), not user coordinates. I think if I had this problem with traditional graphics, I could use grconvertX to make the change. I did come across convertX {grid} but this doesn't seem to be wha

[R] Conditionally Updating Lattice Plots

2008-07-20 Thread Bryan Hanson
Hi All... I can¹t seem to find an answer to this in the help pages, archives, or Deepayan¹s Lattice Book. I want to do a Lattice plot, and then update it, possibly more than once, depending upon some logical options. Code below; it produces a second plot page when the second update is called, fr

Re: [R] .First and .Rprofile won't run on startup

2008-07-14 Thread Bryan Hanson
I accomplish this a little differently. On the mac, in your home directory (e.g. /Users/susanamrose) there is/could be a hidden file called .Rprofile You can edit it with vi for instance by getting a terminal window and >vi .Rprofile It will be created it if it doesn't exist. I keep all my loca

Re: [R] Coloring Stripchart Points, or Better, Lattice Equivalent

2008-06-24 Thread Bryan Hanson
If anyone remains interested, the solution in base graphics is to modify stripchart.default, the last couple of lines where the coloring of points defaults in a way that depends on groups. In my example, the groups are being handled collectively with the coloring. Code is below. Deepayan has not

Re: [R] Coloring Stripchart Points, or Better, Lattice Equivalent

2008-06-23 Thread Bryan Hanson
Thanks Deepayan. That's the conclusion I have gradually reaching! Bryan On 6/23/08 5:57 PM, "Deepayan Sarkar" <[EMAIL PROTECTED]> wrote: > On 6/22/08, Bryan Hanson <[EMAIL PROTECTED]> wrote: >> Thanks Gabor, I'm getting closer. >> >> Is t

Re: [R] Coloring Stripchart Points, or Better, Lattice Equivalent

2008-06-22 Thread Bryan Hanson
as.factor(all$resp) >> stripplot(~ index | resp * yr, all, col = all$col, pch = all$sym, >> layout = c(1, 4)) >> >> >> On Sun, Jun 22, 2008 at 10:43 AM, Bryan Hanson <[EMAIL PROTECTED]> wrote: >>> Below is a revised set of code that demonstrates my ques

Re: [R] Coloring Stripchart Points, or Better, Lattice Equivalent

2008-06-22 Thread Bryan Hanson
Below is a revised set of code that demonstrates my question a little more clearly, I hope. When plotting all the data (5th panel), col & sym don't seem to be passed correctly, as the (random) first value for col & sym are used for all points (run the code, then run it again, you'll see how the 5t

[R] Coloring Stripchart Points, or Better, Lattice Equivalent

2008-06-21 Thread Bryan Hanson
truthfully, I¹d rather be doing this with Lattice, but I¹ve tried several variations of stripplot and can¹t even get something with the general layout of the stripchart version. Thanks, Bryan * Bryan Hanson Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA i

Re: [R] Pointwise Confidence Bounds on Logistic Regression

2008-06-19 Thread Bryan Hanson
bands, binomial(link = "logit")$linkinv)) ## plot confidence bands lines(fit1$model$x, bands$upper1, col = "pink") lines(fit1$model$x, bands$lower1, col = "pink") lines(fit2$model$x, bands$upper2, col = "lightblue") lines(fit2$model$x, bands$lower2,

Re: [R] Pointwise Confidence Bounds on Logistic Regression

2008-06-19 Thread Bryan Hanson
[I've ommitted some of the conversation so far...] > E.g. in a logistic model, with (say) eta = beta_0 + beta_1*x one may > find, on the > linear predictor scale, A and B (say) such that P(A <= eta <= B) = 0.95. > > Then P(expit(A) <= expit(eta) <= expit(B)) = 0.95, which is exactly > what is wan

[R] Pointwise Confidence Bounds on Logistic Regression

2008-06-18 Thread Bryan Hanson
me in the right direction to start writing my own? TIA as always, Bryan * Bryan Hanson Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/lis

[R] Suggestions: Terminology & Pkgs for following spectra over time

2008-04-16 Thread Bryan Hanson
ns as to R pkgs and key words/phrases will be appreciated. TIA, Bryan * Bryan Hanson Professor of Chemistry & Biochemistry DePauw University, Greencastle Indiana USA __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/

[R] Definition of "wrapper"?

2008-03-30 Thread Bryan Hanson
I've looked in a couple of the classic R texts, the extensions and developers' manuals, and R help archives, and didn't find a definition. Of course, I may have missed it. Thanks in advance. Bryan ****** Bryan Hanson Professor of Chemistry & Biochemistry DePauw U

Re: [R] Problem with graphics device in Mac OS X

2007-12-10 Thread Bryan Hanson
For whatever reason, on the Mac, you have to open a new Quartz device window before making the graphics call. So, from the menu, pull down under Window to New Quartz Device Window. Then all graphics calls go to that (initially empty) window, and any further calls replace the previous contents of

[R] Graphical Manova: Fails When There Are Three Factors

2007-11-16 Thread Bryan Hanson
Hi R Gurus & Lurkers... Thanks in advance to anyone who is willing to tackle this! Bryan I have been implementing the graphical manova method described in "An Introduction to Ggobi" (from the Ggobi web site). A stand alone working code is appended below. The code is almost the same as describ

Re: [R] Reading a file with read.csv: two character rows not interpreted as I hope

2007-10-31 Thread Bryan Hanson
= sample.info[1,] sample.colors = sample.info[2,]; sample.colors = as.character(sample.colors[-1]) sample.class = sample.info[3,]; sample.class = as.character(sample.class[-1]) data = read.table(input.file.name, sep=",", skip=3) colnames(data) = sample.names On 10/30/07 10:53 PM, "Bryan Han

Re: [R] Reading a file with read.csv: two character rows not interpreted as I hope

2007-10-30 Thread Bryan Hanson
c.options # here are lines 2-3 > V1 V2 V3 V4 V5 > 1 color green black black green > 2 class Class 1 Class 2 Class 2 Class 1 >> c.data # your data > wavelength SampleA SampleB SampleC SampleD > 1403 0.194 0.214 0.211 0.183 > 2

[R] Reading a file with read.csv: two character rows not interpreted as I hope

2007-10-30 Thread Bryan Hanson
Would it help to put color and class above the x,y data in the file, then clean it off? Btw, I¹m on a Mac using R 2.6.0. Thanks in advance, Bryan * Bryan Hanson Professor of Chemistry & Biochemistry [[alternative HTML version deleted]] __

[R] Accessing scripts in a different directory on a Mac

2007-10-25 Thread Bryan Hanson
Hi all. A question for knowledgeable folks using R on an Intel Mac running OS X 10.4.10 For ease of maintenance, I have broken a large R script into a main script which ³oversees² things by calling other scripts, using ³source². Let¹s call the secondary scripts ³sub-scripts.² I¹d like for the s

<    1   2