You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You have used lowerBound function inside the script of weighted.quantile function.
[weighted.quantile <- function (x, w, probs = seq(0, 1, 0.25), na.rm = FALSE) {
stopifnot(length(x) == length(w))
na <- is.na(x) | is.na(w)
if (any(na)) {
if (na.rm) {
x <- x[!na]
w <- w[!na]
} else {
stop("Missing values not allowed when na.rm is FALSE", call. = FALSE)
}
}
Ensure x and w in ascending order of x
ord <- order(x)
x <- x[ord]
w <- w[ord]
Find closest x just below and above index
n <- sum(w)
index <- 1 + (n - 1) * probs
j <- floor(index)
wts <- cumsum(w) lo <- x[lowerBound(j, wts)] # X_j
hi <- x[lowerBound(j + 1, wts)]
g <- index - j
ifelse(lo == hi, lo, (1 - g) * lo + g * hi)
}
]
But the lowerBound function does not exist in R.
?lowerBound
No documentation for ‘lowerBound’ in specified packages and libraries:
you could try ‘??lowerBound
??lowerBound also showed there is no such function in R.
So, How does it run inside your script???
The text was updated successfully, but these errors were encountered:
You have used lowerBound function inside the script of weighted.quantile function.
[weighted.quantile <- function (x, w, probs = seq(0, 1, 0.25), na.rm = FALSE) {
stopifnot(length(x) == length(w))
na <- is.na(x) | is.na(w)
if (any(na)) {
if (na.rm) {
x <- x[!na]
w <- w[!na]
} else {
stop("Missing values not allowed when na.rm is FALSE", call. = FALSE)
}
}
Ensure x and w in ascending order of x
ord <- order(x)
x <- x[ord]
w <- w[ord]
Find closest x just below and above index
n <- sum(w)
index <- 1 + (n - 1) * probs
j <- floor(index)
wts <- cumsum(w)
lo <- x[lowerBound(j, wts)] # X_j
hi <- x[lowerBound(j + 1, wts)]
g <- index - j
ifelse(lo == hi, lo, (1 - g) * lo + g * hi)
}
]
But the lowerBound function does not exist in R.
?lowerBound
No documentation for ‘lowerBound’ in specified packages and libraries:
you could try ‘??lowerBound
??lowerBound also showed there is no such function in R.
So, How does it run inside your script???
The text was updated successfully, but these errors were encountered: