slice_plot() 找不到函数错误

slice_plot() could not find function error

我正在学习“Computer-age Calculus with R”一书,但无法运行 函数slice_plot(这是第一个用于绘制函数的函数)。安装了库 mosaic、mosaicCalc 和 mosaicModel。我不知道我错过了什么。

这是本书所需库的代码:

library(mosaic)
library(mosaicCalc)
library(mosaicModel)
library(akima)

drug_remaining <- function(dose, duration, time_constant){
  dose * exp(-duration / time_constant)
}

slice_plot(
  drug_remaining(dose = 100, time_constant = 4, duration = t) ~ t, 
  domain(t = 0:20))

我发现 slice_plot() 和 countour_plot() 函数仍在 mosaicCalc 包的测试版中开发,要使用它们,我们需要安装测试版 运行 这段代码:

remotes::install_github("ProjectMOSAIC/mosaicCalc", ref="beta")

https://github.com/ProjectMOSAIC/mosaicCalc/issues/4