
Last chance! 50% off unlimited learning
Sale ends in
set.seed(101)
# Type "discrete"
bad_dis <- new_d(
data.frame(x = sort(runif(100)), prob = runif(100)),
type = "discrete"
)
smoothed_dis <- form_smooth(bad_dis)
plot(bad_dis)
lines(smoothed_dis, col = "blue")
# Type "continuous"
bad_con <- new_d(
data.frame(x = sort(runif(100)), y = runif(100)),
type = "continuous"
)
smoothed_con <- form_smooth(bad_con)
plot(bad_con)
lines(smoothed_con, col = "blue")
Run the code above in your browser using DataLab