Re: [R] count NAs per week

2012-09-18 Thread Tagmarie
Thank you Arun, that was exactly what I was looking for. This is the second time you helped me in this mailing list. Thanks! And also thanks to all of the others of you whou helped me. It is amazing how many possibilities there are to solve my problem (which isn't a prob now anymore). Have a

[R] count NAs per week

2012-09-17 Thread Tagmarie
Even though I work with R since a year or so I still struggle with simple problems. I hope someone can help me with this. Been trying for days and am a little frustrated now. I have a data frame somewhat like the one bellow: dattrial-data.frame(a=c(1,NA,rnorm(4,10)), Week=c(3,3,3,4,4,4)) I

Re: [R] count NAs per week

2012-09-17 Thread R. Michael Weylandt
On Mon, Sep 17, 2012 at 11:03 AM, Tagmarie ramga...@gmx.net wrote: Even though I work with R since a year or so I still struggle with simple problems. I hope someone can help me with this. Been trying for days and am a little frustrated now. I have a data frame somewhat like the one bellow:

Re: [R] count NAs per week

2012-09-17 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Tagmarie Sent: Monday, September 17, 2012 3:03 AM To: r-help@r-project.org Subject: [R] count NAs per week Even though I work with R since a year or so I still struggle with simple

Re: [R] count NAs per week

2012-09-17 Thread arun
(dattrial,dattrial$Week)  unlist(lapply(lapply(list1,`[`, 1),function(x) sum(is.na(x #3 4 #1 0 A.K. - Original Message - From: Tagmarie ramga...@gmx.net To: r-help@r-project.org Cc: Sent: Monday, September 17, 2012 6:03 AM Subject: [R] count NAs per week Even though I work with R

Re: [R] count NAs per week

2012-09-17 Thread Tagmarie
Thank you Michael, that worked perfectly! Now I wonder, if it is possible to break my data further apart and put it together again. Assume I include a column for an ID in the data frame like this: dattrial2-data.frame(a=c(1,NA,NA,NA,2,3), Week=c(3,3,3,4,4,4), AnimalID=c(Ernie,Bert, Ernie,

Re: [R] count NAs per week

2012-09-17 Thread arun
0 A.K. - Original Message - From: Tagmarie ramga...@gmx.net To: r-help@r-project.org Cc: Sent: Monday, September 17, 2012 9:07 AM Subject: Re: [R] count NAs per week Thank you Michael, that worked perfectly! Now I wonder, if it is possible to break my data further apart and put

Re: [R] count NAs per week

2012-09-17 Thread David Winsemius
On Sep 17, 2012, at 6:07 AM, Tagmarie wrote: Thank you Michael, that worked perfectly! Now I wonder, if it is possible to break my data further apart and put it together again. Assume I include a column for an ID in the data frame like this: dattrial2-data.frame(a=c(1,NA,NA,NA,2,3),