The only think that can help is to create a Minimal Working Example (MWE). And we provide here a set of MWE you can modify to obtain yours.
Feel free to ask question here: New Issue for morse R package
Below is reported a set of minimal examples where each
chunk (piece of R
code in grey area) work on its
own.
morse
and its dependencies (JAGS, C++)Use the two classical R
commands:
Recently, a lot of warning messages have appeared when downloading
the morse
package due to an update in its dependencies. We
fix these warnings and we’ll try to do so as soon as possible when new
ones will appear.
Again, feel free to report such messages if they disturb your data processing: New Issue for morse R package
The morse
package is linked to JAGS and C++.
JAGS is the Bayesian sampler used to make inference with survival models.
Download JAGS: https://sourceforge.net/projects/mcmc-jags/
Test and find JAGS
Once installed, JAGS can be lost in the PATH. To help solving this
issue, you can use package runjags
which is not within
morse
so you have to install it.
We assume hereafter that the morse
package is already
installed.
The output should look like this:
You are using R version 4.0.2 (2020-06-22) on a windows machine, with the RStudio GUI
JAGS version 4.3.0 found successfully using the command 'C:/Program Files/JAGS/JAGS-4.3.0/x64/bin/jags-terminal.exe'
The rjags package is installed
Otherwise, you can tell your system where JAGS executable is
(somewhere in
'C:/Program Files/JAGS/JAGS-4.3.0/x64/bin/jags-terminal.exe'
on windows machines):
C++ is used for running simulations. In R, you should not have issue with C++ requirement since it is very well integrated (many R functions are simple interfaces to C++ functions).
For now, we do not have any trouble reported on this use. But feel free to report if there is one: New Issue for morse R package
library(morse)
data("propiconazole")
survData_PRZ = survData(propiconazole)
fit_cstSD = survFit(survData_PRZ, model_type = "SD")
LCx(fit_cstSD, X = 50)
library(morse)
data("propiconazole")
survData_PRZ = survData(propiconazole)
fit_cstSD = survFit(survData_PRZ, model_type = "SD")
data_4MFx <- data.frame(time = 1:10,
conc = c(0,0.5,8,3,0,0,0.5,8,3.5,0))
MFx_PRZ_cstSD <- MFx(object = fit_cstSD, data_predict = data_4MFx, ode = TRUE)
plot(MFx_PRZ_cstSD)
library(morse)
data("propiconazole")
survData_PRZ = survData(propiconazole)
fit_cstSD = survFit(survData_PRZ, model_type = "SD")
data_example <- data.frame(
time = c(1,1.9,2,15,15.1,20),
conc = c(0,0,20,20,0,0),
replicate = rep("example", 6)
)
predict_example_NULL = predict_ode(
object = fit_cstSD,
data_predict = data_example,
mcmc_size = 10,
interpolate_length = NULL)
with few exposure profile time points:
test option interpolate_length
predict_example_100 = predict_ode(
object = fit_cstSD,
data_predict = data_example,
mcmc_size = 10,
interpolate_length = 100)
plot(predict_example_100)
and with a very detailed exposure profile