search for: sumfun

Displaying 4 results from an estimated 4 matches for "sumfun".

2006 Oct 30
2
[LLVMdev] "fork" and "sync" for LLVM thread support - any comments?
...VM generate code to implement the sync in a particular way, e.g. AtomicOpBusyWait AtomicOpYielding Signal etc.. That's it - fork and sync are (I hope) all that's required. A PATRONIZING EXAMPLE: Summing the numbers in an array, using two threads: %sumB = global int 0 int %sumfun(%base, %offset, %count) [simple loop adding numbers from base[offset] to base[offset+count]] void %sumwrap(int *base, int %offset, int %count) %mysum = call int %sumfun(%base, %offset, %count) store int %mysum, int %sumB sync ubyte(42) ret void int %main(void) %array = malloc [1...
2000 Apr 28
1
Using 'by()' in a function
...data argument of by() as a function argument. Is this bug, or am I missing something (or both)? > ### Generate some test data > Test <- vector("list",2) > Test[[1]] <- data.frame(Dose=rep(c(0,1),c(10,10)),Resp1=rnorm(20),Resp2=rnorm(20)) > ### The summary function > sumfun <- function(z) + { + by(data=z, + INDICES=list(factor(z[,"Dose"])), + FUN=function(y) + { + apply(as.matrix(y[,c("Resp1","Resp2")]),2, + function(x)c(Mean=mean(x),SD=sqrt(var(x)))) + } + ) + } > ### Using by works by...
2009 Apr 06
5
SUM,COUNT,AVG
Hi, I ve been searching a lot in internet..but I can t find a solution Attached, you find a file. I need for each (Materiale, tpdv, UM) to find sum,avg and count My idea was to aggregate for the 3 parameters ..but I don t know how to get the numeric value (SUM,COUNT,AVG) I need. Can you help me? thank you http://www.nabble.com/file/p22905322/ordini2008_ex.txt ordini2008_ex.txt -- View this
2013 Jan 17
3
how to use "..."
Dear users, I'm trying to learn how to use the "...". I have written a function (simplified here) that uses doBy::summaryBy(): # 'dat' is a data.frame from which the aggregation is computed # 'vec_cat' is a integer vector defining which columns of the data.frame should be use on the right side of the formula # 'stat_fun' is the function that will be run to