0

I have such a data frame:

value     date
2         09-12
5         09-12
3         09-12
0         09-16
1         09-16
0         09-16
...

There are totally 22 different value in the column date. I would like to subset the data frame in 22 sets, do yo know how to do it? Thanks!

Clarify:

my question is marked as duplicate now. Indeed, they are different. Subset or split one date frame is easy. But how can I apply them in a list of data frames? What I want is a list of subsets, not only single one.

Jamie Bull
  • 12,889
  • 15
  • 77
  • 116
user5779223
  • 1,460
  • 3
  • 21
  • 42
  • `by()` or the combination `split()`/`lapply()` – jogo Apr 12 '16 at 08:24
  • 1
    With your new edit it would seem that by sets you mean a list with 22 elements, however this is not seen from your text or reproducible example. Hence the confusion. – Roman Luštrik Apr 12 '16 at 09:13
  • @RomanLuštrik Thanks for reply. So how can I remove the duplicate tag? – user5779223 Apr 12 '16 at 09:15
  • 1
    Let us worry about closing/opening. Let's first see what you want. Can you confirm that you have a list of data.frames and you would like to subset all of them according to some dates? Can you show a small reproducible example to clear any doubts? – Roman Luštrik Apr 12 '16 at 09:16
  • @Roman, I think they have a data.frame and they want a list of 22 data.frames according to date value (I'm just basing myself on *"What I want is a list of subsets, not only single one"*, the rest is rather confused imo) – Cath Apr 12 '16 at 09:18
  • can you check if `split(df, df$date)` gives you what you want ? – Cath Apr 12 '16 at 09:20
  • @Cath I have tried it and yes, that's what I want. Thanks!!!!!! – user5779223 Apr 12 '16 at 09:23

0 Answers0