Hi,
Not quite understand the question. Do you want to select only certain columns or rows without NAs? Suppose, I have a dataset such as the one below: dattrial<-data.frame(a=c(1,NA,rnorm(4,10)),b=c(NA,NA,NA,3,4,6),c=c(sample(LETTERS[1:3],replace=TRUE), sample(LETTERS[3:5],3,replace=TRUE)),d=runif(6,0.4)) # to eliminate the rows with NAs dattrial1<-dattrial[complete.cases(dattrial),] # to delete columns with NAs dattrial1<-dattrial[,colSums(is.na(dattrial))==0] or dattrial1<-dattrial[rowSums(is.na(dattrial))==0,] A.K. ----- Original Message ----- From: Tagmarie <ramga...@gmx.net> To: r-help@r-project.org Cc: Sent: Saturday, June 16, 2012 4:11 PM Subject: [R] count data without NA in certain time intervals and plot it Hello, I'm quite new to R and still spend hours trying to figure out single things so I hope nobody rolls his eyes over my question. I have a data set over time and converted it to the POSTIXct format. I added a column in the data set for the week and the month. I try to get a plot which shows the weeks on the x-axis and the number of datasets without NAs on the y-axis. That doesn't sound too difficult but I can't figure it out. Does anybody have an idea? -- View this message in context: http://r.789695.n4.nabble.com/count-data-without-NA-in-certain-time-intervals-and-plot-it-tp4633611.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.