I have simplified your function. And I have transposed your results such
that resulting metrics are in columns rather than rows. So, it's not
exactly what you were after, but perhaps you will find it useful.
monthly_summary <- function(dt, r, tol=1E-6) {
# number of days with above tol by year
Hi R-users,
I am new to R. I try to code using the function in R as below:
monthly_summary <- function(dt,r)
{ tol <- 1E-6
mn <- vector(length=12, mode="numeric")
lambda <- vector(length=12, mode="numeric")
ag <- aggregate(dt[,4] > tol, list (dt[,2], dt[,1]), sum)
names(ag) <- c
2 matches
Mail list logo