Ask Your Question

mlanting's profile - activity

2017-05-26 18:45:39 +0200 asked a question 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?

2017-05-26 18:14:25 +0200 received badge  Famous Question (source)
2015-09-28 20:06:48 +0200 received badge  Notable Question (source)
2013-10-09 07:22:08 +0200 received badge  Good Question (source)
2013-07-16 08:33:54 +0200 received badge  Popular Question (source)
2011-11-09 08:54:16 +0200 received badge  Nice Question (source)
2011-11-08 01:23:42 +0200 received badge  Student (source)
2011-10-14 12:20:28 +0200 received badge  Supporter (source)
2011-10-14 12:20:25 +0200 commented answer Converting R variables to sage

hmm.. I was hoping for a more direct variable conversion, but that will work. Thank you!

2011-10-13 16:25:06 +0200 asked a question Converting R variables to sage

If I have a bunch of notebook cells with R code using the %r method, is there an easy way to grab the data as a varible in Python/Sage without converting the whole thing to use r.command syntax?