[R] ggplot question

2021-09-15 Thread Kai Yang via R-help
Hello List, I use ggplot to draw a stack bar chart. but I error message. please look it below: > ggplot(s8_plot, aes(fill=GTresult, y=cases, x=gc_label) + + geom_bar(position="stack", stat="identity")) Error: Mapping should be created with `aes()` or `aes_()`. GTresult and gc_label are chara

Re: [R] ggplot question error: Error in s(x, bs = "cs") : object 'x' not found

2014-11-21 Thread John Kane
<- p + geom_smooth(se = FALSE) p John Kane Kingston ON Canada > -Original Message- > From: dimitri.liakhovit...@gmail.com > Sent: Thu, 20 Nov 2014 17:14:27 -0500 > To: r-help@r-project.org > Subject: [R] ggplot question error: Error in s(x, bs = "cs") : obje

Re: [R] ggplot question error: Error in s(x, bs = "cs") : object 'x' not found

2014-11-20 Thread Dimitri Liakhovitski
Never mind, I found the problem. In my profile s was assigned to summary. This is why it did not work. On Thu, Nov 20, 2014 at 5:14 PM, Dimitri Liakhovitski wrote: > Dear R-ers, > > apologies for not providing the full code. I just need a point in the > right direction. > I have a data frame ('te

[R] ggplot question error: Error in s(x, bs = "cs") : object 'x' not found

2014-11-20 Thread Dimitri Liakhovitski
Dear R-ers, apologies for not providing the full code. I just need a point in the right direction. I have a data frame ('temp') with 1,200 rows and 2 variables. I am using ggplot2 to create a scatter plot: This is my code and it works fine, it creates a scatter plot: library(ggplot2) sp10<-ggplo

Re: [R] GGPLOT Question - #2

2014-04-06 Thread Yvan Richard
Hi Phil, You don't need multiple data frames. A single one will do. Try that. df <- rbind(df1, df2, df3, df4, df5, df6) df$type <- c('a','a','b','b','c','c') ggplot() + geom_crossbar(data = df, aes(ymin=min, ymax=max, x=Treatment, y=min, fill=type, fatten=0)) + scale_fill_manual(values=c(a

Re: [R] GGPLOT Question - #2

2014-04-06 Thread Philip Rhoades
People, On 2014-04-06 22:31, Philip Rhoades wrote: People, OK, the last two bits of the puzzle - can I colour the bars independently and change the scale from linear to logarithmic? To answer my own question - the attached file works for me but I guess could be improved? Thanks, Phil.

Re: [R] GGPLOT Question - #2

2014-04-06 Thread Philip Rhoades
People, OK, the last two bits of the puzzle - can I colour the bars independently and change the scale from linear to logarithmic? Thanks, Phil. On 2014-04-06 22:23, Philip Rhoades wrote: Stephen, On 2014-04-06 22:09, stephen sefick wrote: add +coord_flip() at the end. Does that do it?

Re: [R] GGPLOT Question

2014-04-06 Thread Philip Rhoades
Stephen, On 2014-04-06 22:09, stephen sefick wrote: add +coord_flip() at the end. Does that do it? Wow! - that was a fast response! - yes that works - thanks a lot! Regards, Phil. On Sun, Apr 6, 2014 at 7:03 AM, Philip Rhoades wrote: People, I have this script: library(ggplot2) d

Re: [R] GGPLOT Question

2014-04-06 Thread stephen sefick
add +coord_flip() at the end. Does that do it? On Sun, Apr 6, 2014 at 7:03 AM, Philip Rhoades wrote: > People, > > I have this script: > > library(ggplot2) > > df <- read.table(text = " id min max > Sp1 8.5 13.2 > Sp2 11.7 14.5 > Sp3 14.7 17.7 ", header=TRUE) > > ggplot(df) + > geom_crossba

[R] GGPLOT Question

2014-04-06 Thread Philip Rhoades
People, I have this script: library(ggplot2) df <- read.table(text = " id min max Sp1 8.5 13.2 Sp2 11.7 14.5 Sp3 14.7 17.7 ", header=TRUE) ggplot(df) + geom_crossbar(aes(ymin = min, ymax = max, x = id, y = min), fill = "blue", fatten = 0) - is there some way to get geom_crossbar to print

Re: [R] ggplot question: how to have two y-axis guide on one plot?

2013-12-13 Thread David Winsemius
On Dec 13, 2013, at 6:23 PM, David Winsemius wrote: > > On Dec 13, 2013, at 3:01 PM, Roe, Colleen wrote: > >> I have a plot I'd like to do wherein I plot to different y data sets and >> want to have two different y axis's appear (perhaps one on right side and >> one on left). I searched R h

Re: [R] ggplot question: how to have two y-axis guide on one plot?

2013-12-13 Thread David Winsemius
On Dec 13, 2013, at 3:01 PM, Roe, Colleen wrote: > I have a plot I'd like to do wherein I plot to different y data sets and want > to have two different y axis's appear (perhaps one on right side and one on > left). I searched R help with all the key phrases I could think of and I > have thr

[R] ggplot question: how to have two y-axis guide on one plot?

2013-12-13 Thread Roe, Colleen
I have a plot I'd like to do wherein I plot to different y data sets and want to have two different y axis's appear (perhaps one on right side and one on left). I searched R help with all the key phrases I could think of and I have three books covering ggplot but I can't find an example of doi

Re: [R] ggplot question: changing the label for the Y axis on a histogram

2011-07-25 Thread Steven Rytina, Prof.
Thanks, upgrading the software did the trick. -Original Message- From: istaz...@gmail.com [mailto:istaz...@gmail.com] On Behalf Of Ista Zahn Sent: Monday, July 25, 2011 3:50 PM To: Steven Rytina, Prof. Cc: r-help@r-project.org Subject: Re: [R] ggplot question: changing the label for

Re: [R] ggplot question: changing the label for the Y axis on a histogram

2011-07-25 Thread Ista Zahn
binwidth=.29,main="test")+ylab("NEW") > > -Original Message- > From: istaz...@gmail.com [mailto:istaz...@gmail.com] On Behalf Of Ista Zahn > Sent: Monday, July 25, 2011 2:02 PM > To: Steven Rytina, Prof. > Cc: r-help@r-project.org > Subject: Re: [R] ggplo

Re: [R] ggplot question: changing the label for the Y axis on a histogram

2011-07-25 Thread Steven Rytina, Prof.
ight=cnts,data=qdata,binwidth=.29,main="test")+ylab("NEW") -Original Message- From: istaz...@gmail.com [mailto:istaz...@gmail.com] On Behalf Of Ista Zahn Sent: Monday, July 25, 2011 2:02 PM To: Steven Rytina, Prof. Cc: r-help@r-project.org Subject: Re: [R] ggplot questio

Re: [R] ggplot question: changing the label for the Y axis on a histogram

2011-07-25 Thread Ista Zahn
Hi Steven, The basic example works: qplot(rnorm(100)) + ylab("Bin Counts") Please post a reproducible example that illustrates the problem you are having. Best, Ista On Mon, Jul 25, 2011 at 1:40 PM, Steven Rytina, Prof. wrote: > Some help with how to re-label the vertical axis in a histogram  

[R] ggplot question: changing the label for the Y axis on a histogram

2011-07-25 Thread Steven Rytina, Prof.
Some help with how to re-label the vertical axis in a histogram would be appreciated. qplot(off.sc,weight=rel.freq,binwidth=.29,main="test Figure"+ylab("New from inside"))+ylab("New from outside")+ xlab("off.sc\nAg

Re: [R] ggplot question

2009-07-24 Thread ONKELINX, Thierry
roject.org [mailto:r-help-boun...@r-project.org] Namens RON70 Verzonden: vrijdag 24 juli 2009 11:23 Aan: r-help@r-project.org Onderwerp: [R] ggplot question In page http://had.co.nz/ggplot2/scale_date.html , there is a time series plot for multiple variables at the bottom. i.e qplot(date, value, data

[R] ggplot question

2009-07-24 Thread RON70
In page http://had.co.nz/ggplot2/scale_date.html , there is a time series plot for multiple variables at the bottom. i.e qplot(date, value, data = em, geom = "line", group = variable) + + facet_grid(variable ~ ., scale = "free_y") How can I make different color for different series? Thanks

Re: [R] ggplot question

2008-07-24 Thread hadley wickham
On Thu, Jul 24, 2008 at 2:23 AM, Williams Scott <[EMAIL PROTECTED]> wrote: > I am trying to do something simple with ggplot. I wish to draw a density > plot split by group, and fill each group with a different colour (and > each with an alpha =0.25). I have tried a number of variations of the > fol

[R] ggplot question

2008-07-24 Thread Williams Scott
I am trying to do something simple with ggplot. I wish to draw a density plot split by group, and fill each group with a different colour (and each with an alpha =0.25). I have tried a number of variations of the following, but cannot find a way to define the colour of the fill, its transparency an