In the preamble is some outputObjects prepared, but the variables are empty and even if I add something it doesn't seem to do anything:
outputObjects = data.frame(
objectName = NA_character_,
objectClass = NA_character_,
other = NA_character_,
stringsAsFactors = FALSE
So I tried to find something in the documentation. The most detailed description I could find is this one: https://www.rdocumentation.org/packages/SpaDES/versions/1.3.1/topics/saveFiles
but it seems outdated to me (?). Or can I do it that way?
There is a lot of documentation about caching, and if I where a really advanced user I would certainly try that - but I think I would really like to have files as output that I can read with a simple editor and maybe do some of the analysis without R.. and caching does not work that way, right?
Then, there is this part about saving: Saving
Several information about wolves and packs is saved during the simulation. 9 outputs objects store them (out_terrSize, out_deaths, out_statPack, out_statInd, out_distDisp, out_statSim, out_terr, out_joinCreate, out_dispersers).
But it is within the program, right? And can be passed to plotting, for example.
So if there is another documentation page that I haven't found yet, or if you can tell me where else to look, I would be very grateful.
Thanks, Clara
Once you ran the module with wolfAlpsOutput <- spades(wolfModuleInit), you can access to the ouputs using wolfAlpsOutput$out_terrSize, wolfAlpsOutput$out_deaths, etc...
You can access using wolfAlpsOutput$... to any R objects that is defined as sim$... in the module (out_terrSize, out_deaths, etc. but also the maps, wolves, etc.).
If you want to create a new output, code for it in the module using
sim$myNewOuput <- ...
Then, code in the module to update it as you want during the simulation and then you can retrieve it at the end of the simulation with wolfAlpsOutput$myNewOuput and save it using R functions (save(), writeRaster(), write.csv(), etc.).
I hope this answer your question!
Sarah
Out of curiosity: why didn't you use saveFiles / .saveObjects from the SpaDES package? This seems to be very elegant, even though I don't quite get how it is supposed to work.
Clara
Sarah