search for: summarizeby

Displaying 2 results from an estimated 2 matches for "summarizeby".

Did you mean: summarize
2011 Oct 23
1
unfold list (variable number of columns) into a data frame
...79 77 67 98 2932 2870 2877 2868... So instead of having an associative array (variable number of columns) it should become a simple list where the group or factors are repeated for every occurrence of the specific runtime. Basically my ultimate goal is to get a data frame structure that is "summarizeBy"-friendly and "ggplot2-friendly" i.e. using this data frame format. Help greatly appreciated! TIA, Best regards, Giovanni
2006 Sep 13
1
reshaping a dataset
...rey.codes, 200, replace=T) mass <- runif(200, 0, 10) test <- data.frame(nbpc, trip, set, depth, tagno, prey, mass) ######## Because there are often multiple occurrences of the same prey in a single stomach, I need to sum them for each stomach before using "reshape". Here I use summarizeBy because my understanding of the many variants of "apply" is not very good: ######## test2 <- summaryBy(mass~nbpc+trip+set+tagno+prey, data=test, FUN=sum, keep.names=T, id=~depth) #this messes up sorting order, I fix it k <- order(test2$nbpc, test2$trip, test2$set, test2$tagno)...