#' Run PFIM
#'
#' @description Run PFIM calculations based on specified settings object
#' @param ini arguments to be set for PFIM. The argument names correspond to the object names in that you would normally set in stdin.R.
#' @export
pfim_run <- function(ini = list()) {
out <- list()
if(file.exists(ini$PFIM)) {
e <- new.env()
evalq({
source(ini$PFIM)
if(file.exists(paste0(ini$folder, "/", ini$stdin))) {
sink(file=tempfile())
suppressMessages({
suppressWarnings({
res <- PFIM(ini$stdin)
sink(file=NULL)
return(res)
})
})
} else {
stop("Sorry, stdin script not found, please redefine your settings.")
}
}, envir = e)
} else {
stop("Sorry, PFIM main script not found, please redefine your settings.")
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.