"weightSM" <-
function(weight, typ, sm, pt) {
# weightSM
if (typ == 0) {
if (pt < weight[1]) {
lina <- approxfun(
c(weight[1], weight[1] - sm),
c(weight[3], 1)
)
weight[3] <- lina(pt)
} else {
lina <- approxfun(
c(weight[1], weight[2] + sm),
c(weight[3], 1)
)
weight[3] <- lina(pt)
}
}
weight[3]
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.