Tutorial

library(learnr)
library(mosaicCalc)
knitr::opts_chunk$set(echo = FALSE)

Testing environments

On shinyapps.io, there's a different environment model than on desktop R. A manifestation of this is that eval() statements that work fine in {learnr} tutorials running on the desktop don't work on shinyapps.io.

One example of this is the mosaicCalc::domain() function. The statement in the code block below works fine in this tutorial run on the desktop, but doesn't run on shinyapps.io.

center <- 3
width <- 4
f <- function() {
  f2()
}
f2 <- function() {
  eval(quote(center))
}
f2()
# domain(x = center %pm% width)
# should give list(x=c(-1, 7))


Try the mosaicCalc package in your browser

Any scripts or data that you put into this service are public.

mosaicCalc documentation built on Sept. 11, 2024, 9:10 p.m.