Nothing
knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(caracas)
inline_code <- function(x) { x } if (!has_sympy()) { # SymPy not available, so the chunks shall not be evaluated knitr::opts_chunk$set(eval = FALSE) inline_code <- function(x) { deparse(substitute(x)) } }
n_2 <- as_sym("2") n_pi <- as_sym("pi", declare_symbols = FALSE) # pi is a constant in SymPy x <- sqrt(n_2) * n_pi x N(x) N(x, 5) N(x, 50) as.character(N(x, 50))
As SymPy
requires mpmath
this can be used directly, for example like this (example due to Hans W Borchers, thanks!):
mpmath <- reticulate::import('mpmath') mpmath$mp$dps <- 30 z <- mpmath$mpc(real = '1.0', imag = '63.453') zeta_z <- mpmath$zeta(z) zeta_z as.character(zeta_z$real) as.character(zeta_z$imag)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.