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

2009-08-11 Thread Tim Chatterton
rements for each day to check that the mean and max are likely to be valid (for example I need at least 18 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. -- __

[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"

[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") a