The R Project SVN R-packages

Rev

Rev 5269 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5269 Rev 5315
Line 49... Line 49...
49
        h <- do.call(density,
49
        h <- do.call(density,
50
                     c(list(x = x, weights = weights[subscripts]),
50
                     c(list(x = x, weights = weights[subscripts]),
51
                       darg))
51
                       darg))
52
        ## for banking calculations, include only middle 70% values
52
        ## for banking calculations, include only middle 70% values
53
        quants <-
53
        quants <-
54
            quantile(x, prob = c(0.15, 0.85),
54
            quantile(x, c(0.15, 0.85),
55
                     names = FALSE, na.rm = TRUE)
55
                     names = FALSE, na.rm = TRUE)
56
        ok <- h$x > quants[1] & h$x < quants[2]
56
        ok <- h$x > quants[1] & h$x < quants[2]
57
        list(xlim = range(h$x),
57
        list(xlim = range(h$x),
58
             ylim = range(h$y),
58
             ylim = range(h$y),
59
             dx = diff(h$x[ok]),
59
             dx = diff(h$x[ok]),
Line 78... Line 78...
78
                               darg))
78
                               darg))
79
                xl <- c(xl, h$x)
79
                xl <- c(xl, h$x)
80
                yl <- c(yl, h$y)
80
                yl <- c(yl, h$y)
81
                ## for banking calculations, include only middle 70% values
81
                ## for banking calculations, include only middle 70% values
82
                quants <-
82
                quants <-
83
                    quantile(x[id], prob = c(0.15, 0.85),
83
                    quantile(x[id], c(0.15, 0.85),
84
                             names = FALSE, na.rm = TRUE)
84
                             names = FALSE, na.rm = TRUE)
85
                ok <- h$x > quants[1] & h$x < quants[2]
85
                ok <- h$x > quants[1] & h$x < quants[2]
86
                dxl <- c(dxl, diff(h$x[ok]))
86
                dxl <- c(dxl, diff(h$x[ok]))
87
                dyl <- c(dyl, diff(h$y[ok]))
87
                dyl <- c(dyl, diff(h$y[ok]))
88
            }
88
            }