Displaying 1 result from an estimated 1 matches for "minloc".
Did you mean:
minlod
2007 Mar 23
1
objects of class "matrix" and mode "list"?
...l accept a data frame
# and return a 1-row data frame of
# max value, colname of max, min value, and colname of min
return(data.frame(maxval=max(apply(x,2,max)),
maxloc=names(x)[which.max(apply(x,2,max))],
minval=min(apply(x,2,min)),
minloc=names(x)[which.min(apply(x,2,min))]))
}
# Now applying function to data:
# (1) split the data table by Day with split()
# (2) apply the tmp function defined above to each data frame from (1)
# using lapply()
# (3) transpose the final matrix and convert it to a data frame
# with mixed chara...