I would like to use the new (in 6.4) list output format for BehaviorSpace. It seems just what I need to output a table of values for each patch at the end of a run. But the description is very brief, there is no code example, and just a screenshot of a spreadsheet example but no table version.
Here is what my colleague and I want to do. We want to have a table output for analysis in R that has the following for each patch:
globalvar 1, globalvar2, pxcor, pycor, patchvar1, patchvar2, patchvar3
We’ve created a reporter
to-report patchoutput
report [(list pxcor pycor patchvar1 patchvar2 patchvar3)] of patches
end
We put this in the output metrics. We specify globalvar1 and globalvar2 as the variables to vary in the experiment. We create table and list output files using the same base names. And we get an output with a line for each combination of globalvar1 and globalvar2, and columns for each of the 5 variables for each patch.
So far so good.
But the patch variable columns are just numbered from 1 to 500 (100 patches with 5 variables).
For analysis, we need each patch on its own line with the globals and patch variables. Is there a way to code this for that kind of result?
Alternatively, is there a way to get variable names for the patch columns instead of numbers? If we could do that, we could pivot the columns into lines in R.
Any other tips or code examples on using this new feature?