2

In base-R, if you have a data frame and want to output all possible combinations of variables, you can use expand.grid()

I was looking for something similar in Microsoft R/RevoscaleR when dealing with XDF files which are too large to be in memory.

Any ideas?

Thanks!

Thomas Moore
  • 941
  • 2
  • 11
  • 17
  • It's something that would be good to get an answer for this topic but why not make a small example so demonstration code would be more likely to appear and be useful for future searches? It would also be good to provide information about the number of unique items in such a use case. – IRTFM Jul 05 '17 at 01:25
  • I couldn't find any function similar to expand.grid that does this by looking at [here](https://learn.microsoft.com/en-us/r-server/r-reference/revoscaler/revoscaler), perhaps check `rxDataStep`. Another option is to convert it to data.frame with one of the Rx functions but if memory is a constraint it would not be viable – akrun Jul 05 '17 at 01:28
  • There is no built-in function for this, and I suspect writing one would be nontrivial. – Hong Ooi Jul 05 '17 at 01:34
  • I guess this is related to your [previous question](https://stackoverflow.com/questions/44830697/expand-grid-in-r-vector-is-too-large-error). The answer is: don't do this. Even if you could create such a combinatorial object, actually computing anything with it will take a ridiculously long time. You need to find a smarter way of checking your model. – Hong Ooi Jul 05 '17 at 02:08
  • But, I really, really want to do this. :) – Thomas Moore Jul 05 '17 at 02:24
  • No, you really, really don't. More hardware is not an excuse to use an O(p^N) approach. – Hong Ooi Jul 05 '17 at 02:40
  • I know. I now have to come up with a more clever solution. – Thomas Moore Jul 05 '17 at 03:10

0 Answers0