[R] barchart (lattice) with text labels

2007-02-24 Thread Mark and Heather Lyman
I would like to place the value for each bar in barchart (lattice) at the top of each bar. Something like the following code produces. library(lattice) mypanelfunc - function(x, y, ...) { panel.barchart(x, y, ...) panel.text(x, y, labels=as.character(round(x,2)), ...) } myprepanelfunc -

Re: [R] Google Custom Search Engine for R

2007-02-24 Thread Stephen Tucker
There appears to be another site (linked from Wikipedia) that lists some of the sites that it searches: http://www.dangoldstein.com/search_r.html --- Steven McKinney [EMAIL PROTECTED] wrote: Whereas R is very generic, CRAN is much less so. I've had very good luck adding CRAN to my

Re: [R] How to plot two graphs on one single plot?

2007-02-24 Thread Stephen Tucker
you can also call plot(x1,y1) par(new=TRUE) plot(x2,y2,axes=FALSE) but this is more helpful for when you want to plot with multiple y-axes. in general, it is also possible to build up from low-level graphical elements: plot.new() plot.window(xlim=range(x1),ylim=range(y1)) lines(x1,y1) axis(1);

Re: [R] Overlaying graphics

2007-02-24 Thread Stephen Tucker
Not pretty, but you could possibly try: # first map map(#arguments#) xylim = par(usr) # second map out = map(#arguments#, plot=FALSE) par(xaxs=i,yaxs=i) plot.window(xlim=xylim[1:2],ylim=xylim[3:4]) polygon(out) --- Takatsugu Kobayashi [EMAIL PROTECTED] wrote: Rusers: This is a very

[R] Making two lines graph ...

2007-02-24 Thread Petar Milin
Hello! Can anyone help me to build a graph with the alphanumeric values on x-axis, with two lines (preferably doted and solid, or similar) that present values on y-axes. In a toy example, data frame could be like this: x.orig x.num y1 y2 a 1 0.2 0.4 b 2 0.1 0.1 c 3 0.3 0.3 d 4 0.3 0.15 e 5 0.1

Re: [R] pdf with an exact size

2007-02-24 Thread Renaud Lancelot
The package grid provides very convenient tools for such things: library(grid) pdf(file = square.pdf, paper = a4) pushViewport(viewport()) grid.rect(width = 100, height = 100, default.units = mm) dev.off() works just fine for me (R 2.4.1, MS WIndows XP): the printed output on my inkjet printer

[R] gsub: replacing a.*a if no occurence of b in .*

2007-02-24 Thread Ulrich Keller
I am trying to read a number of XML files using xmlTreeParse(). Unfortunately, some of them are malformed in a way that makes R crash. The problem is that closing tags are sometimes repeated like this: tagvalue1/tagtagvalue2/tagsome garbage/tag/tagtagvalue3/tag I want to preprocess the contents

[R] recovering collums of DF using a text var.list

2007-02-24 Thread Milton Cezar Ribeiro
Hello people, I would like to know how can I use a list of variables (a char list) to have access to the collums from a dataframe to be used in some analysis like, just as example, a ploting task on a for() loop. Of course the code below is just to understand the way. In this example I have a

Re: [R] How to plot two graphs on one single plot?

2007-02-24 Thread Nguyen Dinh Nguyen
Hi Yun, try this. x1 - rnorm(1, 0.5,0.4018) x2 - rnorm(1, 0.01919,0.3969) d1 - density(x1) d2 - density(x2) plot(range(d1$x,d2$x), range(d1$y, d2$y), type = n, xlab = X, ylab = Y ) lines(d1, col = blue,lwd=2) lines(d2, col = red,lwd=2) Cheers Nguyen -Original Message-

Re: [R] Making two lines graph ...

2007-02-24 Thread jim holtman
Does this do what you want? x - x.orig x.num y1 y2 a 1 0.2 0.4 b 2 0.1 0.1 c 3 0.3 0.3 d 4 0.3 0.15 e 5 0.1 0.05 x.in - read.table(textConnection(x), header=TRUE) plot(x.in$y2, type='l', ylim=range(x.in$y1, x.in$y2), xaxt='n', col='red', xlab='', ylab='y') lines(x.in$y1, lty=2, col='green')

Re: [R] random uniform sample of points on an ellipsoid (e.g. WG

2007-02-24 Thread Ted Harding
[Apologies if this is a repeated posting for you. Something seems to have gone amiss with my previous attempts to post this reply, as seen from my end] On 22-Feb-07 Roger Bivand wrote: On 21 Feb 2007, Russell Senior wrote: I am interested in making a random sample from a uniform

Re: [R] problem with weights on lmer function

2007-02-24 Thread Douglas Bates
On 2/23/07, Ronaldo Reis Junior [EMAIL PROTECTED] wrote: Em Quinta 22 Fevereiro 2007 20:36, Andrew Robinson escreveu: Hi Ronaldo, I suggest that you send us a small, well-documented, code example that we can reproduce. It certainly looks as though there is a problem, but given this

Re: [R] gsub: replacing a.*a if no occurence of b in .*

2007-02-24 Thread Peter Dalgaard
Ulrich Keller [EMAIL PROTECTED] writes: I am trying to read a number of XML files using xmlTreeParse(). Unfortunately, some of them are malformed in a way that makes R crash. The problem is that closing tags are sometimes repeated like this: tagvalue1/tagtagvalue2/tagsome

Re: [R] gsub: replacing a.*a if no occurence of b in .*

2007-02-24 Thread Marc Schwartz
On Sat, 2007-02-24 at 15:03 +0100, Peter Dalgaard wrote: Ulrich Keller [EMAIL PROTECTED] writes: I am trying to read a number of XML files using xmlTreeParse(). Unfortunately, some of them are malformed in a way that makes R crash. The problem is that closing tags are sometimes

Re: [R] Making two lines graph ...

2007-02-24 Thread Marc Schwartz
Or a possible alternative still using matplot: matplot(DF[, 3:4], type = b, xaxt = n, pch = c(21, 22), col = black, lty = c(dotted, solid), ylab = Y Vals, xlab = Groups) axis(1, at = 1:5, labels = as.character(DF$x.orig)) legend(topright, legend = c(Group 1, Group 2),

Re: [R] gsub: replacing a.*a if no occurence of b in .*

2007-02-24 Thread Charilaos Skiadas
All these methods do assume that you don't have nested tag's, like so: tagtagfoo/taguseful stuff/tagsome garbage/tag For that you would really need a true parser. So I would double-check to make sure this doesn't happen. Do you have any control on where those XML files are generated though?

Re: [R] gsub: replacing a.*a if no occurence of b in .*

2007-02-24 Thread Gabor Grothendieck
The _question_ assumed that, which is why the answers did too. On 2/24/07, Charilaos Skiadas [EMAIL PROTECTED] wrote: All these methods do assume that you don't have nested tag's, like so: tagtagfoo/taguseful stuff/tagsome garbage/tag For that you would really need a true parser. So I would

Re: [R] Multiple comparisons when interacction]

2007-02-24 Thread Jorge Lampurlanes Castel
Hello, I send the message again with the data file as txt because it seems not to be accepted as csv in the R-help list. Data comes from a multiyear field experiment in which 4 levels of a treatment (2, 3, 4, 6) are compared to see the effect on yield. It is a randomized complete block design.

Re: [R] gsub: replacing a.*a if no occurence of b in .*

2007-02-24 Thread Charilaos Skiadas
On Feb 24, 2007, at 11:37 AM, Gabor Grothendieck wrote: The _question_ assumed that, which is why the answers did too. Oh yes, I totally agree, the file snippet the OP provided did indeed assume that, though nothing in the text of his question did, so I wasn't entirely clear whether the

Re: [R] gsub: replacing a.*a if no occurence of b in .*

2007-02-24 Thread Jeffrey Horner
Charilaos Skiadas wrote: On Feb 24, 2007, at 11:37 AM, Gabor Grothendieck wrote: The _question_ assumed that, which is why the answers did too. Oh yes, I totally agree, the file snippet the OP provided did indeed assume that, though nothing in the text of his question did, so I wasn't

[R] Woolf's test, Odds ratio, stratification

2007-02-24 Thread francogrex
Just a general question concerning the woolf test (package vcd), when we have stratified data (2x2 tables) and when the p.value of the woolf-test is below 0.05 then we assume that there is a heterogeneity and a common odds ratio cannot be computed? Does this mean that we have to try to add more

Re: [R] barchart (lattice) with text labels

2007-02-24 Thread Mark and Heather Lyman
Deepayan Sarkar wrote: On 2/24/07, Mark and Heather Lyman [EMAIL PROTECTED] wrote: I would like to place the value for each bar in barchart (lattice) at the top of each bar. Something like the following code produces. library(lattice) mypanelfunc - function(x, y, ...) {

Re: [R] problem with weights on lmer function

2007-02-24 Thread Andrew Robinson
Hi Ronaldo, Thanks, that's helpful! I also don't get an error. Mind you, I added data=test to the model call. This is my system: sessionInfo() R version 2.4.1 Patched (2006-12-30 r40330) i386-unknown-freebsd6.1 locale: C attached base packages: [1] stats graphics grDevices utils

[R] independent text in panels

2007-02-24 Thread Sumitrajit Dhar
Hi Folks, The following gives me the exact plot I want using trellis. xyplot(V56 ~ V12 | subset(frequency, V17 12000) , data=kdata, ylab=Fine Structure Depth [dB], xlab=QSIN score, panel=function(x,y,...) { panel.xyplot(x[HL==N],y[HL==N], pch=16,col=green)

Re: [R] random uniform sample of points on an ellipsoid (e.g. WG

2007-02-24 Thread Ranjan Maitra
Hi, Sorry for being a late entrant to this thread, but let me see if I understand the problem. The poster wants to sample from an ellipsoid. Let us call this ellipsoid X'\Gamma X - d^2= 0. There is no loss in assuming that the center is zero, otherwise the same can be done. Let us consider

Re: [R] recovering collums of DF using a text var.list

2007-02-24 Thread Petr Klasterecky
Milton Cezar Ribeiro napsal(a): Hello people, I would like to know how can I use a list of variables (a char list) to have access to the collums from a dataframe to be used in some analysis like, just as example, a ploting task on a for() loop. Of course the code below is just to

Re: [R] Woolf's test, Odds ratio, stratification

2007-02-24 Thread Marc Schwartz
On Sat, 2007-02-24 at 10:30 -0800, francogrex wrote: Just a general question concerning the woolf test (package vcd), when we have stratified data (2x2 tables) and when the p.value of the woolf-test is below 0.05 then we assume that there is a heterogeneity and a common odds ratio cannot be

Re: [R] random uniform sample of points on an ellipsoid (e.g. WG

2007-02-24 Thread Ted Harding
On 24-Feb-07 Ranjan Maitra wrote: Hi, Sorry for being a late entrant to this thread, but let me see if I understand the problem. The poster wants to sample from an ellipsoid. Let us call this ellipsoid X'\Gamma X - d^2= 0. There is no loss in assuming that the center is zero, otherwise

Re: [R] random uniform sample of points on an ellipsoid (e.g. WG

2007-02-24 Thread Ranjan Maitra
My method is for the surface, not for the interior. The constraint d*X/|| \Gamma^{-1/2}X ||ensures the constraint, no? The uniformity is ensured by the density restricted to satisfy the constraint which makes it a constant. Ranjan On Sat, 24 Feb 2007 22:49:25 - (GMT) (Ted Harding) [EMAIL