Skip to content

gam in geom_smooth doesn't use s() when manually specified: #1931

@Ax3man

Description

@Ax3man

Consider:

ggplot(diamonds, aes(price, carat)) + geom_smooth()

##`geom_smooth()` using method = 'gam'

rplot

But with manual specification of the method:

ggplot(diamonds, aes(price, carat)) + geom_smooth(method = "gam")

rplot04

Something seems to off with the default formula, since

ggplot(diamonds, aes(price, carat)) + geom_smooth(method = "gam", formula = y ~ s(x, bs = "cs"))

produces same as the first plot. Is this intentional? For what it is worth, this behavior was already there in v1.0.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions