Às 00:36 de 13/12/2023, Robert Baer escreveu:
coord_cartesian also seems to work for y, and including the breaks = .
How about:
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
y = "PISA score in mathematics") +
scale_y_continuous(limits=c(470,500),oob=scales::squish)
Regards,
Tim
-Original Message-
From: R-help On Behalf Of varin sacha via R-help
Sent: Tuesday, December 12, 2023 4:19 PM
To: r-help@r-project.org; Ben Bolker
Subject: Re: [R] ggplot2: Get the r
coord_cartesian also seems to work for y, and including the breaks = .
How about:
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 =
Use scale_x_continuous() and specify your desired breaks
On Tue, Dec 12, 2023, 4:19 PM varin sacha wrote:
> Dear Ben,
> Dear Daniel,
> Dear Rui,
> Dear Bert,
>
> Here below my R code.
> I really appreciate all your comments. My R code is perfectly working but
> there is still something I would
Dear Ben,
Dear Daniel,
Dear Rui,
Dear Bert,
Here below my R code.
I really appreciate all your comments. My R code is perfectly working but there
is still something I would like to improve. The X-axis is showing 2012.5 ;
2015.0 ; 2017.5 ; 2020.0
I would like to see on X-axis only the
On 2023-12-11 5:27 p.m., Daniel Nordlund wrote:
On 12/10/2023 2:50 PM, Rui Barradas wrote:
Às 22:35 de 10/12/2023, varin sacha via R-help escreveu:
Dear R-experts,
Here below my R code, as my X-axis is "year", I must be missing one
or more steps! I am trying to get the regression line
On 12/10/2023 2:50 PM, Rui Barradas wrote:
Às 22:35 de 10/12/2023, varin sacha via R-help escreveu:
Dear R-experts,
Here below my R code, as my X-axis is "year", I must be missing one
or more steps! I am trying to get the regression line with the 95%
confidence bands around the regression
This can easily be done using predict.lm to get the intervals (confidence
or prediction).
?predict.lm contains a plotting example using ?matplot from the graphics
package. Here's a somewhat verbose version for your example (first
converting Year to numeric, of course):
df=data.frame(year=
Às 22:35 de 10/12/2023, varin sacha via R-help escreveu:
Dear R-experts,
Here below my R code, as my X-axis is "year", I must be missing one or more
steps! I am trying to get the regression line with the 95% confidence bands around the
regression line. Any help would be appreciated.
Best,
Dear R-experts,
Here below my R code, as my X-axis is "year", I must be missing one or more
steps! I am trying to get the regression line with the 95% confidence bands
around the regression line. Any help would be appreciated.
Best,
S.
#
10 matches
Mail list logo