piecewise | R Documentation |
Create a piecewise object
as_piecewise(pw)
piecewise_cond(pw)
piecewise_expr(pw)
pw |
A caracas object containg a Piecewise specification |
A list
Søren Højsgaard
if (has_sympy()) {
library(caracas)
def_sym(r, n, j)
sum1 <- sum_(r^j, var=j, lower=0, upper=n)
pw <- as_piecewise(sum1)
pw[[2]]$expr
pw |> piecewise_cond()
pw |> piecewise_expr()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.