Re: [R] Barplot with lines

2012-11-25 Thread Ripples
Hi Jim, I did the same and it worked. Thanks a lot! SK On Fri, Nov 23, 2012 at 6:11 PM, Jim Lemon wrote: > On 11/24/2012 02:21 AM, skanap wrote: > >> >> Hi Jim, >> >> Thank you for the reply. But, when I use Barpos I get this error. >> >> plot(mydata$score,barpos) >> Error in xy.coords(x, y, x

Re: [R] Barplot with lines

2012-11-23 Thread Jim Lemon
On 11/24/2012 02:21 AM, skanap wrote: Hi Jim, Thank you for the reply. But, when I use Barpos I get this error. plot(mydata$score,barpos) Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ I need all the points in x-axis that are in 'days' column. If I'm selecting o

Re: [R] Barplot with lines

2012-11-23 Thread skanap
Hi Jim, Thank you for the reply. But, when I use Barpos I get this error. plot(mydata$score,barpos) Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ I need all the points in x-axis that are in 'days' column. If I'm selecting only points in val1 and val2 I'm missing

Re: [R] Barplot with lines

2012-11-23 Thread Greg Snow
Look at the updateusr function in the TeachingDemos package. One of the examples shows adding lines to a barplot. On Fri, Nov 23, 2012 at 12:33 AM, Ripples <9ripp...@gmail.com> wrote: > Hi, > > I'm trying to plot stacked barplot with lines on it. Here is the data. > > emp days val1 val2 score

Re: [R] Barplot with lines

2012-11-23 Thread Jim Lemon
On 11/23/2012 06:33 PM, Ripples wrote: Hi, I'm trying to plot stacked barplot with lines on it. Here is the data. emp days val1 val2 score 1 21 1 0 1200 2 35 1 1 na 3 42 na na 3000 4 53 2 1 2100 5 64 1 0 na 6 73 na na 1400 My X-axis is days. I'm looking to plot val1,val2 as stacked bars and s

Re: [R] barplot with lines instead of bars

2009-09-09 Thread John Kane
My bad memory? I forgot that option existed. --- On Wed, 9/9/09, S Ellison wrote: > From: S Ellison > Subject: Re: [R] barplot with lines instead of bars > To: r-help@r-project.org, "John Kane" > Received: Wednesday, September 9, 2009, 12:02 PM > What is wrong with

Re: [R] barplot with lines instead of bars

2009-09-09 Thread S Ellison
plot(1, 1, xlim=c(0,5),ylim=c(min(d), max(d)), type="n", xaxt="n", xlab="Hi There", ylab="Skinny bars") arrows(xps1,yps1, xps2,yps2, angle=0, col=c("red","blue","green"), lwd=2) ============

Re: [R] barplot with lines instead of bars

2009-09-09 Thread John Kane
s1, xps2,yps2, angle=0, col=c("red","blue","green"), lwd=2) ============== --- On Tue, 9/8/09, rafamoral wrote: > From: rafamoral > Subject: Re: [R] barplot with lines instead of bars > To: r-help@r-proje

Re: [R] barplot with lines instead of bars

2009-09-08 Thread Henrique Dallazuanna
Try this: matplot(matrix(1:length(d), NCOL(d), byrow = TRUE), t(d), type = 'h', lty = 1, lwd = 2) On Tue, Sep 8, 2009 at 11:44 AM, Rafael Moral wrote: > Dear useRs, > > I want to plot the following barplot with lines instead of bars. Is there a > way? > > data <- data.frame(cbind(k = 0:3, fk = c

Re: [R] barplot with lines instead of bars

2009-09-08 Thread John Kane
Have a look at ?segments and/or ?arrows. --- On Tue, 9/8/09, rafamoral wrote: > From: rafamoral > Subject: Re: [R] barplot with lines instead of bars > To: r-help@r-project.org > Received: Tuesday, September 8, 2009, 2:12 PM > > How can I draw thin bars in a barplot? >

Re: [R] barplot with lines instead of bars

2009-09-08 Thread John Kane
--- On Tue, 9/8/09, hadley wickham wrote: > From: hadley wickham > Subject: Re: [R] barplot with lines instead of bars > To: "rafamoral" > What's the difference between a line > and a thin bar? > Hadley Diet? > > On Tue, Sep 8, 2009 at 12:17 PM, ra

Re: [R] barplot with lines instead of bars

2009-09-08 Thread rafamoral
How can I draw thin bars in a barplot? Rafael hadley wrote: > > What's the difference between a line and a thin bar? > Hadley > > On Tue, Sep 8, 2009 at 12:17 PM, rafamoral > wrote: >> >> I'm sorry, but I think I was misunderstood. What I need is something like >> this: >> >> http://img525.ima

Re: [R] barplot with lines instead of bars

2009-09-08 Thread hadley wickham
What's the difference between a line and a thin bar? Hadley On Tue, Sep 8, 2009 at 12:17 PM, rafamoral wrote: > > I'm sorry, but I think I was misunderstood. What I need is something like > this: > > http://img525.imageshack.us/img525/2818/imagemyu.jpg > > Lines instead of bars > > Thanks! > > Raf

Re: [R] barplot with lines instead of bars

2009-09-08 Thread rafamoral
I'm sorry, but I think I was misunderstood. What I need is something like this: http://img525.imageshack.us/img525/2818/imagemyu.jpg Lines instead of bars Thanks! Rafael. ONKELINX, Thierry wrote: > > Here is a solutions using ggplot2 and reshape > > library(reshape) > library(ggplot2) > d

Re: [R] barplot with lines instead of bars

2009-09-08 Thread ONKELINX, Thierry
Here is a solutions using ggplot2 and reshape library(reshape) library(ggplot2) data <- data.frame(k = 0:3, fk = c(11, 20,7,2), f0k = c(13.72, 17.64, 7.56, 1.08), fkest = c(11.85, 17.78, 8.89, 1.48)) Molten <- melt(data, id.vars = "k") ggplot(Molten, aes(x = k, y = value, colour = variable)) + g