omnetpp-resultfiles icon indicating copy to clipboard operation
omnetpp-resultfiles copied to clipboard

Make itervar-values contained in sca- and vec-files available to R

Open mbyrenh opened this issue 4 years ago • 2 comments

Hi,

the commit in this pull request extends the loadDataset function such that the returned dataframe also includes the "itervar"-entries from the scalar/vector files, making it easier to group different runs by simulation parameter values.

The code added to the processLine-method of the ResultFileManager-class is similar to the code regarding processing of run attributes. One rather subtle change is that I replaced the line PROTECT(dataset = NEW_LIST(9)) at the beginning of the exportDataset-method in loadDataset.cc with PROTECT(dataset = NEW_LIST(datasetColumnsLength)), as to me it seems that the "9" was just a hard-coded version of the number of dataset columns.

I am also not familiar with writing R extensions and I am not sure if the call to UNPROTECT(1) is at the right place or if it should occur just after all the itervar entries have been added to the dataframe.

Kind regards, Martin

mbyrenh avatar Jan 30 '20 17:01 mbyrenh