single element list in R
I'm using R to filter a large dataset to a dictionary of lists of values, and using those lists in Sage/Python to make plots. The data is a bunch of measurements between nodes, and I'm trying to automate filtering the data into a bunch of lists for the different permutations nodes. However, if a node pair only consists of one measurement, R is returning it as a float instead of a single element list (this is with the r('measurements$node1$node2$value')._sage_()
interface). This is causing code later on to choke. I'd like to avoid a bunch of ugly type-checking on the return values from R if possible.
Is there a way to force R to return a single element list instead of a float some other single-value numeric type?
It is hard to reproduce the problem in both R and sage. We miss for instance
measurementsnode1node2
. If this can be hard coded to mock the situation in R, we have a better grip on the problem. And there is hard to see where the code is getting the (sage or R?) chain. My problems were some years ago of the shape(It's hard to recover the initial structure of R, and to use R data.) Please give some more details, if possible.