library(osmose)
Define a folder for copy example files:
exampleFolder <- tempdir()
# Show the temporary folder
cat(exampleFolder)
#> /var/folders/3c/807k30_50mv_53hr_lqb6q0c0000gn/T//Rtmp1DrbUl
# Copy files
demoPaths <- osmose_demo(path = exampleFolder, config = "gog")
Run the example using run_osmose
function (it will take less than 1 min):
run_osmose(input = demoPaths$config_file)
#> This is OSMOSE version 3.3.3
#> Your file osmose_3.3.3.jar has been download and/or deziped in this folder : /var/folders/3c/807k30_50mv_53hr_lqb6q0c0000gn/T//Rtmp1DrbUl/osmose_3.3.3.jar
#> Running: 'java' -jar '/var/folders/3c/807k30_50mv_53hr_lqb6q0c0000gn/T//Rtmp1DrbUl/osmose_3.3.3.jar' /var/folders/3c/807k30_50mv_53hr_lqb6q0c0000gn/T//Rtmp1DrbUl/gog/osm_all-parameters.csv
Read outputs and config using read_osmose
function
outputs <- read_osmose(path = demoPaths$output_dir,
input = demoPaths$config_file)
# Print osmose outputs
print(outputs)
#> OSMOSE v.3u2
#> Model 'gogosm'
#>
#> 11 species modeled (3 simulations):
#> [sp0] OctopusVulgaris
#> [sp1] MelicertusKerathurus
#> [sp2] MetapenaeusMonoceros
#> [sp3] TrachurusTrachurus
#> [sp4] SardinaPilchardus
#> [sp5] SardinellaAurita
#> [sp6] EngraulisEncrasicolus
#> [sp7] DiplodusAnnularis
#> [sp8] MustelusMustelus
#> [sp9] MerlucciusMerluccius
#> [sp10] PagellusErythrinus
#>
#> Available fields:
#>
#> "model" "yieldBySize"
#> "species" "yieldNBySize"
#> "biomass" "meanTLBySize"
#> "abundance" "mortalityBySize"
#> "yield" "dietMatrixBySize (*)"
#> "yieldN" "predatorPressureBySize"
#> "mortality" "abundanceByAge"
#> "meanTL" "biomassByAge"
#> "meanTLCatch" "yieldByAge"
#> "biomassByTL" "yieldNByAge"
#> "predatorPressure" "meanSizeByAge"
#> "predPreyIni" "meanTLByAge"
#> "dietMatrix" "mortalityByAge"
#> "meanSize" "dietMatrixByAge (*)"
#> "meanSizeCatch" "predatorPressureByAge"
#> "abundanceBySize" "config"
#> "biomassBySize" "---------"
#>
#> (*) Empty fields.
osmose
classplot(outputs, what = "biomass")
plot(outputs, what = "biomass", type = 2)
plot(outputs, what = "abundance", ts = FALSE, type = 1)
plot(outputs, what = "yield", ts = FALSE, type = 2)
plot(outputs, what = "abundanceByAge")
plot(outputs, what = "biomassBySize", type = 2)
plot(outputs, what = "biomassByTL", type = 1)
plot(outputs, what = "yieldBySize", type = 2)
osmose.config
classIt is important to remember that config info has already been read in outputs
object and you can access just by indexing outputs$config
.
plot(outputs$config, what = "species")
plot(outputs$config, what = "predation")
plot(outputs$config, what = "reproduction", type = 1)
plot(outputs$config, what = "reproduction", type = 2)