Graphics Reference
In-Depth Information
By default,
stat_smooth()
also adds a 95% confidence region for the regression fit. The con-
# 99% confidence region
sp
+
geom_point()
+
stat_smooth(method
=
lm, level
=
0.99
)
# No confidence region
sp
+
geom_point()
+
stat_smooth(method
=
lm, se
=
FALSE
FALSE
)
The default color of the fit line is blue. This can be change by setting
colour
. As with any other
line, the attributes
linetype
and
size
can also be set. To emphasize the line, you can make the
sp
+
geom_point(colour
=
"grey60"
)
+
stat_smooth(method
=
lm, se
=
FALSE
FALSE
, colour
=
"black"
)