get_y_function <- function(y, slope) {
function(x) x * slope + y
}
get_x_intercept <- Vectorize(function(y, slope) {
intercept <- (y * -1) / slope
if (is.na(intercept)) {
intercept <- NA_real_
} else if (intercept == Inf) {
intercept <- NA_real_
}
intercept
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.