[R] Counting the number of non-NA values per day

2009-08-11 Thread Tim Chatterton
hourly measurements to calculate a valid daily mean) Try as I might I have not found a simple way of doing this. Can anybody help please? Many thanks, Tim. -- __ Dr Tim Chatterton Senior Research Fellow Air Quality Management Resource Centre Faculty

[R] Getting the month out of my date as a number not characters

2009-07-02 Thread Tim Chatterton
I have a data frame (hf) that is all set up and the dates are working fine - however I need to extract the months and hours (2 separate columns) as numbers - however they are coming out as characters. I have tried both the following: hf50$hour= hf50$date hf50$hour=format(hf50[hour],%H) and

[R] Getting the month out of my date as a number not characters

2009-07-02 Thread Tim Chatterton
I have a data frame (hf) that is all set up and the dates are working fine - however I need to extract the months and hours (2 separate columns) as numbers - however they are coming out as characters. I have tried both the following: hf50$hour - hf50$date hf50$hour - format(hf50[hour],%H)