search for: sumd

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

Did you mean: sum
2011 Sep 03
2
problem in applying function in data subset (with a level) - using plyr or other alternative are also welcome
...t;- ifelse(mydf[x[1]] == mydf[x[3]], 1, -1) ot2 <- ifelse(mydf[x[2]] == mydf[x[4]], 1, -1) qt <- ot1 + ot2 return(qt) } qt <- apply(mmat, 1, myfun) ydv <- c((y - mean(y))^2) qtd <- data.frame(ped, ydv, qt) # second function myfun2 <- function(dataframe) { vydv <- sum(ydv)*0.25 sumD <- sum(ydv * qt) Rt <- vydv / sumD return(Rt) } # using plyr require(plyr) dfsumd1 <- ddply(mydf,.(mydf$ped),myfun2) Here are 2 issues: (1) The output just one, I need the output for all three set of variables (as listed above) (2) all three values of dfsumd is returning to same for al...
2009 May 20
10
How to google for R stuff?
Hi! I'm new to R programming, though I've been programming in other languages for years. One thing I find most frustrating about R is how difficult it is to use Google (or any other search tool) to look for answers to my R-related questions. With languages with even slightly more distinctive names like Perl, Java, Python, Matlab, OCaml, etc., usually including the name of the language