Pts <- tibble(x = seq(-4,4, by=.7), y = dnorm(x))
f <- qspliner(y ~ x, data = Pts)
slice_plot(dnorm(x) ~ x, domain(x=-4:4)) %>%
slice_plot(f(x) ~ x, color= "blue") %>%
gf_point(y ~ x, data = Pts, color = "orange", size=4, alpha=0.3) %>%
gf_lims(y= c(NA,.5))
Run the code above in your browser using DataLab