Displaying 1 result from an estimated 1 matches for "maxloc".
Did you mean:
malloc
2007 Mar 23
1
objects of class "matrix" and mode "list"?
...24*3))
# define a function to get a set of descriptive statistics
tmp <- function(x) {
# this function will 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...