1

Is there a way to perform a basic split of ff_vectors without any sums or such things? I have a ffdf called res2 consisting of 2 ff_vectors, and I want the following, from a ffdf like this:

A     B
a     1
a     2
b     4
b     5        

result should be a list like with the use of split function:

$a 
1 2

$b
4 5

I want to create transactions out of these stuff and perform analysis on them, but I require to organize my data correctly first.

Centar 15
  • 127
  • 1
  • 13
  • i have no idea what happened, but there was a suggestion to use: tapply(data$B, data$A, function(x) x) which caused error: tapply(data$B, data$A, function(x) x) – Centar 15 Aug 29 '16 at 11:22
  • Do you need `split(df$B, df$A)` ? – Ronak Shah Aug 29 '16 at 11:29
  • Yes exactly, but the problem is that it doesn't work with ffdf. The comment is: Error in as.vmode(value, vmode) : argument "value" is missing, with no default – Centar 15 Aug 29 '16 at 11:30
  • [Check out this link](http://stackoverflow.com/questions/16470677/using-tapply-ave-functions-for-ff-vectors-in-r). – Sotos Aug 29 '16 at 11:50
  • `split(df[, 'B'], df[,'A'])` – Ronak Shah Aug 29 '16 at 11:57
  • Ronak's code worked!!! For some reason I can't transform it now the result to transcactions now, even thought the same result received through a different process worked. Error says: Error in as(i, "transactions") : no method or default for coercing “list” to “transactions” – Centar 15 Aug 29 '16 at 12:11
  • Ronak you can add your code as an asnwer, and I will gladly accept it as an answer, if you find your ranking important :) – Centar 15 Aug 29 '16 at 12:12
  • I posted it as an answer. As far as you getting another error is concerned, you should post a new question with it. – Ronak Shah Aug 29 '16 at 12:16
  • http://stackoverflow.com/questions/39207697/parsing-as-transactions-in-r If anyone finds the time, I'd be mostly grateful. Hopefully the apriori will work after that without any complain. – Centar 15 Aug 29 '16 at 13:38

1 Answers1

0

You can try,

split(df[, 'B'], df[,'A'])

which would give

#$a
#[1] 1 2

#$b
#[1] 4 5
Ronak Shah
  • 377,200
  • 20
  • 156
  • 213