search for: bylist

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

Did you mean: mylist
2005 Sep 30
4
by() processing on a dataframe
...232 2 1 1 -0.0474712 3 1 2 -0.6808021 4 1 2 1.9894999 5 2 3 2.0154786 6 2 3 0.4333056 7 2 4 -0.4746228 8 2 4 0.6017522 > > handleonegroup <- function(subset) data.frame(gp1 = subset$gp1[1], + gp2 = subset$gp2[1], statistic = mean(subset$value)) > > bylist <- by(dataset, list(dataset$gp1, dataset$gp2), handleonegroup) > > result <- do.call('rbind', bylist) > result gp1 gp2 statistic 1 1 1 0.45092598 11 1 2 0.65434890 12 2 3 1.22439210 13 2 4 0.06356469 tapply() is inappropriate because I don't have...
2009 Nov 05
2
Using a by() function to process several regression (lm()) functions
...09 5:00 Site 2 396 495 10/12/09 5:00 Site 2 1022 497 10/12/09 5:00 Site 2 1304 574 I tried this: bylist.lm <- by(df, list(df$Date, df$Site), function(x) lm(Concentration~Sample_interval, data=x)) Then, I get a list of stuff...which seems hard very exact much... I tried this... rate <- (sapply(bylist.lm, coef)[2,]) and got, the rates, but I can't figure out how to line them up with...