[R] persuade tabulate function to count NAs in a data frame

2011-03-19 Thread Bodnar Laszlo EB_HU
Hi, I'd like to ask you a question again. It is basically about data frames, NAs and tabulate function. I have this data frame. I already used this in one of the previous questions of mine. It intentionally looks this simple, my real 'df' dataframe is much bigger actually and again, I am not

Re: [R] persuade tabulate function to count NAs in a data frame

2011-03-19 Thread Gavin Simpson
On Sat, 2011-03-19 at 15:58 +0100, Bodnar Laszlo EB_HU wrote: Hi, I'll top-post as the original Q is very lengthy: tabs -lapply(df[,2:6], function(x, id){ t(table(addNA(x), id, useNA = ifany)) }, df$id) is one way of doing what you want. More details are here:

Re: [R] persuade tabulate function to count NAs in a data frame

2011-03-19 Thread Jim Lemon
On 03/20/2011 01:58 AM, Bodnar Laszlo EB_HU wrote: Hi, I'd like to ask you a question again. It is basically about data frames, NAs and tabulate function. Hi Bodnar, The freq function in the prettyR package might do what you want. Jim __