if (FALSE) {
# !!! running this example will install the python module `fiora`
td <- fioRa::test_data
x <- setNames(data.frame(
t(sapply(td[2:11], function(x) { strsplit(x, ",")[[1]] }))),
strsplit(td[1], ",")[[1]]
)
foo <- run_script(x = x)
foo[[1]][["spec"]]
# modify parameters
run_script(x = x[1,,drop=FALSE], min_prob = 0.05)
# you may also return a Spectra object
run_script(x = x[1,,drop=FALSE], min_prob = 0.05, annotation = TRUE, fmt = "Spectra")
# use a different fiora environment/model
s_pth <- "c:/Users/jlisec/AppData/Local/r-miniconda/envs/fiora-0.1.0/Scripts/fiora-predict"
# this setup will be used internally
fioRa:::find_fiora_predict_paths(default_path = dirname(s_pth), script_name = basename(s_pth))
# run the script
foo2 <- run_script(x = x, fiora_script = s_pth)
foo2[[1]][["spec"]]
for (i in 1:length(foo)) {
cat("\n")
print(names(foo)[i])#'
print(foo[[i]][["spec"]])
print(foo2[[i]][["spec"]])
}
}
Run the code above in your browser using DataLab