I have a daily dataset that looks like this: 

```
date       CMA0013 CMA0047 CMA0052 CMA0067
1975-10-01       0   0.012   0.078       0
1975-10-02       0   0.012   0.078       0
1975-10-03       0   0.012   0.078       0
1975-10-04       0   0.012   0.078       0
1975-10-05       0   0.012   0.078       0
1975-10-06       0   0.012   0.078       0
...

```

In R, I want to count (summarize) by month and year how many records in each column meet the condition `< 0.001`. Let's say to get something like:

```
month   year    CMA0013   CMA0047   CMA0052   CMA0067
   10   1975          6         0         0         6
   11   1975        ...

```

I have tried different options using `aggregate` and `ddply` functions, but, since my knowledge on them is not yet very deep, I couldn't get any satisfactory solution. Thanks to all for any help you provide

An example that didn't work with `ddply`

```
df$year <- year(df$date)
df$month <- month(df$date)

df2 <- ddply(df,~year+month,summarise,
count = length(df[,df$CMA0010 < 0.001]))

```

It doesn't do the sum correctly, and it only does it for one column (CMA0010)