search for: breakdown2

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

Did you mean: breakdown
2006 Apr 20
0
Breakdown a number [Broadcast]
...han my description. > > > > > bp <- c(0, 250, 800, 1200) > > > diff(bp) > > [1] 250 550 400 > > Don't think diff method is going to work either, at > least in cases where the 'whole' is less than greatest > 'break'. > > > breakdown2 <- function(x, breaks = c(250, 800)) { > diff(c(0, breaks, x)) > } > > breakdown(10) # 10 0 0 > > breakdown2(10) # 250 550 -790 > > > > breakdown(400) # 250 150 0 > > breakdown2(400) # 250 550 -400 > > > ------------------------------------...