简体   繁体   中英

splitting ff_vectors in r

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.

You can try,

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

which would give

#$a
#[1] 1 2

#$b
#[1] 4 5

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM