Re: [R] Counting occurences of variables in a dataframe

2012-02-12 Thread Kai Mx
Amazing. Thanks everybody for the help. I have about 12,000 rows of data with up to 50 reccurrences, but it seems to work like a charm. Best, Kai On Sun, Feb 12, 2012 at 8:11 AM, Petr Savicky wrote: > On Sat, Feb 11, 2012 at 04:05:25PM -0500, David Winsemius wrote: > > > > On Feb 11, 2012, at

Re: [R] Counting occurences of variables in a dataframe

2012-02-11 Thread Petr Savicky
On Sat, Feb 11, 2012 at 04:05:25PM -0500, David Winsemius wrote: > > On Feb 11, 2012, at 1:17 PM, Kai Mx wrote: > > >Hi everybody, > >I have a large dataframe similar to this one: > >knames <-c('ab', 'aa', 'ac', 'ad', 'ab', 'ac', 'aa', 'ad','ae', 'af') > >kdate <- as.Date( c('20111001', '2002

Re: [R] Counting occurences of variables in a dataframe

2012-02-11 Thread David Winsemius
On Feb 11, 2012, at 1:17 PM, Kai Mx wrote: Hi everybody, I have a large dataframe similar to this one: knames <-c('ab', 'aa', 'ac', 'ad', 'ab', 'ac', 'aa', 'ad','ae', 'af') kdate <- as.Date( c('20111001', '2002', '20101001', '20100315', '20101201', '20110105', '20101001', '20110504', '20110

Re: [R] Counting occurences of variables in a dataframe

2012-02-11 Thread Petr Savicky
On Sat, Feb 11, 2012 at 07:17:54PM +0100, Kai Mx wrote: > Hi everybody, > I have a large dataframe similar to this one: > knames <-c('ab', 'aa', 'ac', 'ad', 'ab', 'ac', 'aa', 'ad','ae', 'af') > kdate <- as.Date( c('20111001', '2002', '20101001', '20100315', > '20101201', '20110105', '20101001',

Re: [R] Counting occurences of variables in a dataframe

2012-02-11 Thread Tal Galili
Hello Kai This looks like a fun question. Here is my solution, I'd be curious to see solutions by other people here. It can also be tweaked in various ways, and easily put into a function (actually, if you do it - please put it back online :) ) The only thing that might require some work is the r