Displaying 20 results from an estimated 117 matches for "geom_smooth".
2023 Aug 12
2
geom_smooth
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))+
? geom_point()+
? geom_smooth(se=TRUE,fill="blue",color="black",l...
2009 Aug 18
1
ggplot2: geom_smooth and legend
Hi all,
Is that possible to remove the grey colour in the legend key that goes
with the geom_smooth? In my case it doesn't ease the reading of the
legend.
http://www.4shared.com/file/125864977/e10644f8/desorb.html
Cordialement / Regards
-------------------------------------------
Benoit Boulinguiez
Ecole de Chimie de Rennes (ENSCR) Bureau 1.20
Equipe CIP UMR CNRS 6226 "Sciences Chi...
2012 Mar 15
2
ggplot2: goem_smooth and suppress messages
Hi
When I run my script using ggplot and geom_smooth I get messages that I
would like to suppress:
p <- ggplot(dataSubset)
p <- p + aes(x = as.Date(factor(key),format="%Y%m%d")) + geom_line()
p <- p + geom_smooth(span=0.2,se=FALSE,size=0.7)
The messages look like this:
geom_smooth: method="auto" and size of largest grou...
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))+
> ? geom_point()+
> ? geom_smooth(se...
2023 Aug 12
1
geom_smooth
G'day Thomas,
On Sat, 12 Aug 2023 04:17:42 +0000 (UTC)
Thomas Subia via R-help <r-help at r-project.org> wrote:
> Here is my reproducible code for a graph using geom_smooth
The call "library(tidyverse)" was missing. :)
> I'd like to add a black boundary around the shaded area. I suspect
> this can be done with geom_ribbon but I cannot figure this out. Some
> advice would be welcome.
This works for me:
ggplot(scatter_data,aes(x=x_var,y=y_var,...
2012 Oct 30
4
Error unary operator
Hi R - listers,
I am receiving an error. Does anyone know what this means? J
ggplot(subset(foo, Rayos != "Rayos.NA"), aes(x=HTL, y=DevelopIndex,
colour=TotalEggs)) +geom_point() +geom_jitter() +
facet_grid(Aeventexhumed ~ Rayos)
+ geom_smooth(method="lm", fill=NA) + ylim(c(0, 7))
Error in +geom_smooth(method = "lm", fill = NA) :
invalid argument to unary operator
[[alternative HTML version deleted]]
2016 Jul 20
4
Geom_smooth
Default level = 0.95.
Does this mean +/- 0.025 from estimate?
[[alternative HTML version deleted]]
2012 Oct 04
0
extract fit values from geom_smooth
Dear all,
I have a plot with two gaussian distributions:
ggplot( tofdf, aes( x = tof, y = counts ) ) +
geom_histogram( stat = "identity", position = "stack", fill = 2 ) +
geom_smooth( method = "nls", formula = y ~ (a/b)*exp(-(x-c)^2/(2*b^2)) +
(d/e)*exp(-(x-f)^2/(2*e^2)), se=F,
start=list(a=100, b=1, c=695, d=100, e=1, f=710),
control=nls.control(tol=1E-5, minFactor=1/1024),
n = 1000 )
Now I would like to extract some valu...
2017 Sep 07
0
Geom_smooth
...ML version deleted]]
I would have guessed that it meant something along the lines of localized (or one might say "loess-ized") mean +/- 2* similarly localized standard error of the estimate. To find out what the base R version of loess does consult `?predict.loess` and to find out what `geom_smooth` does, you can try to find documentation on the `predictdf` fucntion, but the geom_smooth help pages warns you it is undocumented.
--
David Winsemius
Alameda, CA, USA
'Any technology distinguishable from magic is insufficiently advanced.' -Gehm's Corollary to Clarke's Third Law
2008 Sep 22
2
adding layers in ggplot2 (data and code included)
...505
0 2 4.296608
1 2 4.826036
2 2 4.765386"),header=TRUE);
closeAllConnections();
I can form two plots, scatter and lines, as follows:
p <- ggplot(mydata, aes(x=Est, y=Tri))
p + geom_point(aes(colour=factor(Group),shape=factor(Group)))
and
p+ geom_smooth(aes(group=factor(Group),color=factor(Group)),method=lm,se=F).
However, I am unable to have the plots together.
I obtain the following error:
> p + geom_point(aes(colour=factor(Group),shape=factor(Group)))+geom_smooth(aes(group=factor(Group),color=factor(Group)),method=lm,se=F)
Error in `[.dat...
2023 May 16
1
Newbie: Drawing fitted lines on subset of data
...e that I think illustrates what I'm trying to do.
The commented out sections show what I've tried to far:
## Short example to test segments:
w <- tsibble(
date = as.Date("2022-01-01") + 0:99,
value = rnorm(100)
)
ggplot(data = w, mapping = aes(date, value)) +
geom_smooth(method = "lm", se = FALSE) +
geom_point()
## Below gives error about ignoring data
## geom_abline( data = w$date[25:75] )
## Gives error ''data' must be in <data.frame>'
## geom_smooth(data = w$date[25:35],
## method = lm,...
2010 Nov 30
1
Zooming in to a ggplot (a sort of ylim, but ylim won't do)
Dear Helpers,
I wonder whether you might be able to help me. I have a plot composed of
ggplot (and a follow on geom_smooth call). I would like to restrict the
display range of the y axis to a smaller range, a sort of zooming onto a
region. I attempted to use ylim, but it will effect the range (i.e. effect
the geom_smooth call). Is there any way that I can save the results up to
geom_smooth call and then restrict the pr...
2023 May 16
0
Newbie: Drawing fitted lines on subset of data
...t I've tried to far:
>>
>> ## Short example to test segments:
>>
>> w <- tsibble(
>> ????? date = as.Date("2022-01-01") + 0:99,
>> ????? value = rnorm(100)
>> )
>>
>> ggplot(data = w, mapping = aes(date, value)) +
>> ????? geom_smooth(method = "lm", se = FALSE) +
>> ????? geom_point()
>> ????? ## Below gives error about ignoring data
>> ????? ## geom_abline( data = w$date[25:75] )
>> ????? ## Gives error ''data' must be in <data.frame>'
>> ????? ## geom_smooth(data =...
2007 Jun 14
1
back-transform predictors for x-axis in plot -- mgcv package
My question is related to plot( ) in the mgcv package. Before modelling
the data, a few predictors were transformed to normalize them.
Therefore, the x-axes in the plots show transformed predictor values.
How do I back-transform the predictors so that the plots are easier to
interpret?
Thanks in advance,
Suzan
--
Suzan Pool
Oregon State University
Cooperative Institute for Marine
2011 Jan 25
1
ggplot - controlling point size
...owing for me?
How can I get rid of the blue line in the key in the second plot?
## Create a simple data frame
df=data.frame(x=1:1000, y=2*1:1000+rnorm(1000,sd=1000),
type=sample(letters[1:2],1000, replace=TRUE))
## Very nice! Almost what I want
qplot(x, y, data=df, colour=factor(type)) + geom_smooth()
## Make a nicer plot, with smaller points
## but why does that add the little blue line with a 1?
qplot(x, y, data=df, colour=factor(type), size=1) + geom_smooth()
[[alternative HTML version deleted]]
2013 Dec 17
1
ggplot2: stat_smooth for family=binomial with cbind(Y, N) formula
With ggplot2, I can plot the glm stat_smooth for binomial data when the
response is binary or
a two-level factor as follows:
data("Donner", package="vcdExtra")
ggplot(Donner, aes(age, survived)) +
geom_point(position = position_jitter(height = 0.02, width = 0)) +
stat_smooth(method = "glm", family = binomial, formula = y ~ x,
alpha = 0.2, size=2)
But how can I
2023 May 12
2
Newbie: Controlling legends in graphs
...9;ve tried in the
commented out sections:
weights %>%
group_by(year(Date)) %>%
summarize(
m_K = mean(K, na.rm = TRUE),
m_J = mean(J, na.rm = TRUE),
) %>%
ggplot(aes(x = `year(Date)`)) +
geom_point(aes(y = m_K, color = "red")) +
geom_smooth(aes(y = m_K, color = "red")) +
geom_point(aes(y = m_J, color = "blue")) +
geom_smooth(aes(y = m_J, color = "blue")) +
guides(size = "legend",
shape = "legend")
## scale_shape_discrete(name="Person",
##...
2023 Dec 14
0
R-help Digest, Vol 250, Issue 13
...is is showing 2012.5 ; 2015.0 ; 2017.5 ; 2020.0
I would like to see on X-axis only the year (2012 ; 2015 ; 2017 ; 2020). How to do?
#########
library(ggplot2)
df=data.frame(year= c(2012,2015,2018,2022), score=c(495,493, 495, 474))
ggplot(df, aes(x = year, y = score)) + geom_point() + geom_smooth(method = "lm", formula = y ~ x) +
labs(title = "Standard linear regression for France", x = "Year", y = "PISA score in mathematics") + scale_y_continuous(limits=c(470,500),oob=scales::squish)
#########
Le lundi 11 d?cembre 2023 ? 23:38:06 UTC+1, Ben...
2010 Jun 24
1
Displaying additional values on the Y-axis ggplot2
Hi,
I am running the following code:
mfg0 <- ggplot(aes(x=Grade,y=Math,colour=RiskStatic45678),data=math.f)
mfg1 <- mfg0 + geom_smooth(method="lm", formula=y ~ ns(x,2),size=1) +
geom_smooth(aes(y=nalt.math,color="NALT"),size=1,data=nalt) +
scale_colour_brewer("Risk Status", pal="Set1") + coord_cartesian(ylim =
c(175, 245))
mfg1
And when I specify that, the only value that shows up on th...
2012 Dec 12
1
ggplot - adding regression lines
...wo regression lines on a scatter plot each
corresponding to a treatment group.
The default plot gives a different slope for each treatment group. However,
in some cases i want the lines to be parallel -ie no significant
interaction.
My code:
ggplot(data=df,X,Y,colour=treatment) + geom_point() +
geom_smooth(method="lm")
I think i use the 'formula' option in geom_smooth but have been unable to
find a solution.
thanks for any advice.
sy
--
View this message in context: http://r.789695.n4.nabble.com/ggplot-adding-regression-lines-tp4652906.html
Sent from the R help mailing list a...