Using the following data:
> str(attribute)
'data.frame': 431 obs. of 2 variables:
$ pos: int 1 2 3 4 5 6 7 8 9 10 ...
$ att: num 0.652 0.733 0.815 1.079 0.885 ... *[between 0 and 3]
and:
ggplot(attribute, aes(x=pos, y=att)) + geom_line() + geom_smooth()
I did:
I would like to progressively smooth the black curve, not "as much as" geom_smooth default did. I've tried n
, level
options, but didn't do what I want. Which would be the best way to increase smoothing progressively? (e.g. average 2 values in one, then try 3 in one, and so on). I guess it's something really easy or achievable without using geom_smooth
, but I don't know what to search/look for. Thanks.
This is documented in
stat_smooth
. The default smoother isloess
, and additional arguments are passed on to it, as specified for the description of the...
argument. So what you want isspan
:Additionally,
loess
accepts adegree
argument for more control over the amount of smoothing.