Displaying 20 results from an estimated 4000 matches similar to: "Newbie: Drawing fitted lines on subset of data"
2023 May 16
1
Newbie: Drawing fitted lines on subset of data
Hello,
I's still working with my tsibble of weight data for the last 20 years. 
In addition to drawing an overall trend line, using lm, for the whole 
data set, I'd like to draw short lines that would recompute lm and draw 
it, say, just for the years from 2010:2015.
Here's a short example that I think illustrates what I'm trying to do. 
The commented out sections show what
2023 Dec 14
0
R-help Digest, Vol 250, Issue 13
Kevin,
Maybe also look at what air quality monitoring is being done in area.
https://cran.r-project.org/web/packages/RAQSAPI/vignettes/RAQSAPIvignette.html
Depends what and how near, but might be something relevant there?
Karl
Dr Karl Ropkins
Transport Studies | Environment | University of Leeds
------------------------------
Message: 2
Date: Tue, 12 Dec 2023 07:52:59 -0800
From: Bert Gunter
2023 May 16
0
Newbie: Controlling legends in graphs
Rui, thanks so much for your help. Your explanation and example were 
clear and concise. Thanks for taking the time and effort to help me.
-Kevin
On 5/12/23 16:06, Rui Barradas wrote:
> ?s 14:24 de 12/05/2023, Kevin Zembower via R-help escreveu:
>> Hello, I'm trying to create a line graph with a legend, but have no
>> success controlling the legend. Since nothing I've
2008 Apr 04
0
ggplot2 - version 0.6
ggplot2 ------------------------------------------------------------
ggplot2 is a plotting system for R, based on the grammar of graphics,
which tries to take the good parts of base and lattice graphics and
avoid bad parts. It takes care of many of the fiddly details
that make plotting a hassle (like drawing legends) as well as
providing a powerful model of graphics that makes it easy to produce
2008 Apr 04
0
ggplot2 - version 0.6
ggplot2 ------------------------------------------------------------
ggplot2 is a plotting system for R, based on the grammar of graphics,
which tries to take the good parts of base and lattice graphics and
avoid bad parts. It takes care of many of the fiddly details
that make plotting a hassle (like drawing legends) as well as
providing a powerful model of graphics that makes it easy to produce
2011 Jun 26
1
changing graphs in qqplot2
This is what I have now so far.
p=ggplot(data = test, aes(x = YEAR, y = TOTAL, colour = TREATMENT)) +
geom_point() + geom_smooth(method = "lm", se=FALSE) + facet_wrap(~COUNTRY)
> p +scale_x_continuous(limits=c(1,4))
http://r.789695.n4.nabble.com/file/n3626510/graph.gif 
I would also like to:
1.) change the headline for the faced wraps ?high? and ?low?. Is there any
other way of
2008 Dec 14
0
New version of ggplot2, 0.8.1
ggplot2 ------------------------------------------------------------
ggplot2 is a plotting system for R, based on the grammar of graphics,
which tries to take the good parts of base and lattice graphics and
avoid bad parts. It takes care of many of the fiddly details
that make plotting a hassle (like drawing legends) as well as
providing a powerful model of graphics that makes it easy to produce
2008 Dec 14
0
New version of ggplot2, 0.8.1
ggplot2 ------------------------------------------------------------
ggplot2 is a plotting system for R, based on the grammar of graphics,
which tries to take the good parts of base and lattice graphics and
avoid bad parts. It takes care of many of the fiddly details
that make plotting a hassle (like drawing legends) as well as
providing a powerful model of graphics that makes it easy to produce
2023 Aug 12
1
geom_smooth
?s 05:17 de 12/08/2023, Thomas Subia via R-help escreveu:
> Colleagues,
> 
> Here is my reproducible code for a graph using geom_smooth
> set.seed(55)
> scatter_data <- tibble(x_var = runif(100, min = 0, max = 25)
>  ?????????????????????? ,y_var = log2(x_var) + rnorm(100))
> 
> library(ggplot2)
> library(cowplot)
> 
> ggplot(scatter_data,aes(x=x_var,y=y_var))+
2007 Jul 24
1
ggplot2 axis color
Hi:
Does anyone have an idea on how to color the axis and
labels using ggplot2? This is what I got:
library(ggplot2)
 p <- qplot(total_bill, tip, data = tips)
 NewPlot<-  p + geom_abline(slope=c(0.1,0.15,0.2),
colour=c("red","blue","yellow"),size=c(2,5,2))
NewPlot + geom_smooth(colour="green",
size=3,linetype=3)
2007 Oct 03
1
ggplot2: problem with geom_errorbar and geom_abline
Hi all,
I  have run into what appears to be a bug in ggplot2; however, I am new 
to the ggplot syntax, so I might be missing a key element. The main 
issue is that I cannot get geom_abline to plot when colour is used to 
identify "group" in the main plot. When I remove colour, geom_abline 
works but the error bars have an undesirable line drawn between the left 
edges of the caps. Does
2023 May 12
2
Newbie: Controlling legends in graphs
Hello, I'm trying to create a line graph with a legend, but have no 
success controlling the legend. Since nothing I've tried seems to work, 
I must be doing something systematically wrong. Can anyone point this 
out to me?
Here's my data:
 > weights
# A tibble: 1,246 ? 3
    Date           J     K
    <date>     <dbl> <dbl>
  1 2000-02-13   133  188
  2
2007 Nov 08
1
ggplot2 geom_abline slope not working?
I am learning ggplot2, and need your help.
When I try 
> p <- ggplot(mtcars, aes(x = wt, y=mpg)) + geom_point() 
> p + geom_abline(slope=5) 
(from http://had.co.nz/ggplot2/geom_abline.html)
the slope of the abline does not change, but this works:
> p + geom_abline(intercept=20)
In order to have slope work, I have to use 
> p + geom_abline(aes(slope=5)) 
Is it a bug, or is there
2020 Oct 26
0
How to shade area between lines in ggplot2
Hi
Put fill outside aes
p+geom_ribbon(aes(ymin = slope_1*x + intercept_1 - 1/w[2],
ymax = slope_1*x + intercept_1 + 1/w[2]), fill = "blue", alpha=0.1)
The "hole" is because you have two levels of data (red and blue). To get rid 
of this you should put new data in ribbon call.
Something like
newdat <- trainset
newdat$z <- factor(0)
p+geom_ribbon(data=newdat, aes(ymin =
2020 Oct 23
0
How to shade area between lines in ggplot2
Hi
What about something like
p+geom_ribbon(aes(ymin = slope_1*x + intercept_1 - 1/w[2],
ymax = slope_1*x + intercept_1 + 1/w[2], fill = "grey70", alpha=0.1))
Cheers
Petr
> -----Original Message-----
> From: Luigi Marongiu <marongiu.luigi at gmail.com>
> Sent: Friday, October 23, 2020 11:11 AM
> To: PIKAL Petr <petr.pikal at precheza.cz>
> Cc: r-help
2020 Oct 23
2
How to shade area between lines in ggplot2
Thank you, but this split the area into two and distorts the shape of
the plot. (compared to
```
p + geom_abline(slope = slope_1, intercept = intercept_1 - 1/w[2],
                    linetype = "dashed", col = "royalblue") +
  geom_abline(slope = slope_1, intercept = intercept_1 + 1/w[2],
              linetype = "dashed", col = "royalblue")
```
Why there
2020 Oct 23
2
How to shade area between lines in ggplot2
also from this site: https://plotly.com/ggplot2/geom_ribbon/
I get the answer is geom_ribbon but I am still missing something
```
#! plot
p = ggplot(data = trainset, aes(x=x, y=y, color=z)) +
  geom_point() + scale_color_manual(values = c("red", "blue"))
# show support vectors
df_sv = trainset[svm_model$index, ]
p = p + geom_point(data = df_sv, aes(x=x, y=y),
                  
2023 Oct 31
0
Missing shapes in legend with scale_shape_manual
I believe the missing shapes are because you had set alpha=0 for the last geom point. 
I expect there are better ways, but one way to handle it would be to avoid the filtering, adding columns with med and exercise status, like the following:
# setup with data provided
Date <- c('2023-10-17', '2023-10-16', '2023-10-15', '2023-10-14',
        
2023 Oct 31
0
Missing shapes in legend with scale_shape_manual
Tim, thanks, it helps very much. It works like a charm.
Wow, there's so much I don't understand about ggplot2 functions,
especially the aes() function. I just discovered the ggplot2-book.org
site, and I hope to read it slowly and carefully over the next couple
of weeks.
Thanks again, Tim, for all your help.
-Kevin
On Tue, 2023-10-31 at 12:35 +0000, Howard, Tim G (DEC) wrote:
> I
2011 Jul 10
2
grey colored lines and overwriting labels i qqplot2
I created this graph in ggplot and added ablines to the different facets by
specifying with subset commands.  As you might see, there are still a few
issues.
1.)	I would like to have the diamonds in a grey scale instead of colors. I
accomplished this (see graph 2) until I overwrote the label title for the
treatments and the colors came back (graph 1). I used these two commands:
p=ggplot(data =