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?