Hi:
 I have been able to finally crunch my data by
importing it by week(thank you all for your help),but
here we go again..
 Now I'am trying to do it for the the whole year.
Since the
 dataset is huge I'm only making a 3 weeks dataframe.
- I want to get the mean of pd by week
- I want to count the number of days by week and bind
it to the existing dataframe(x)
- I want to remove the NA's by week and bind another
column counting the rows after the NA's are removed.
 Don't think that I'am crazy but I need those fields
 for my annual report. I was trying to use some of
 the functions below but nothing seems to work..One
 of these days I'll be an R pro(we'll see about that)
 Thanks
 
week<-c(28,28,28,28,28,28,28,29,29,29,29,29,29,29,30,30,30,30,30,30,30)
td<-c(0.015,0.012,NA,0.015,NA,0.014,0.014,0.013,0.013,0.013,0.013,NA,0.010,0.013,0.015,0.011,0.014,0.014,0.014,0.014,0.016)
pd<-c(0,0,NA,80,NA,45,223,228,224,488,525,NA,80,417,413,373,914,213,651,521,979)
 x<-data.frame(week,td,pd)
 x
  pmean<- tapply(x[,3], x$week, mean)
    pdmean
    pdmean<- data.frame(pmean)
    pdmean
 xweek <- aggregate(x, list(x$week), mean)
xweek

 Felipe D. Carrillo
  Fishery Biologist
  Department of the Interior
  US Fish & Wildlife Service
  California, USA



      
____________________________________________________________________________________
Be a better friend, newshound, and

______________________________________________
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.

Reply via email to