search for: fromvals

Displaying 1 result from an estimated 1 matches for "fromvals".

2011 Jan 17
2
Difficult with round() function
...ngth(benchmarks) else{ fracs[i] <- (positions[i] - sum(positions[1:(i-1)]))/length(benchmarks) } } #AND UPDATES STARTVEC INDECES AND FRACTION MULTIPLIERS if(max(positions) != length(benchmarks)) indeces <- c(indeces, max(indeces) + 1) if(sum(fracs) != 1) fracs <- c(fracs, 1 - sum(fracs)) fromVals <- startVec[indeces] if(any(is.na(fromVals))){ NAindex <- which(is.na(fromVals)) if(sum(Fracs[-NAindex]) >= 0.5) shortVec[j] <- sum(fromVals*fracs, na.rm=TRUE) else shortVec[j] <- NA }else{shortVec[j] <- sum(fromVals*fracs)} } return(shortVec) } for the simple test case test &...