I have 2 tables (a
and b
) with 365 records each (1 year data). I want to get mean of each month in table a
and if it falls below 0.01 then remove all daily values belonging to that month and output a new table. Also, I want corresponding daily values to be removed from table b
as well to produce a new table for it.
For example: If January and April have monthly mean less than 0.01 then output table a
and b
with 304 values each. Outputs from dput(head(a))
and dput(head(b))
are respectively:
structure(list(V1 = c(0, 0, 0, 0.43, 0.24, 0)), .Names = "V1", row.names = c(NA, 6L), class = "data.frame")
structure(list(V1 = c(0.042022234, 0.014848409, 0.275174289, 0.485364883, 0.177960815, 0.006799459)), .Names = "V1", row.names = c(NA, 6L), class = "data.frame")
I don't know how to use list comprehension in R. Any suggestions would be appreciative.