3482
правки
Изменения
м
→Выводы
<syntaxhighlight lang="rsplus">
getAnywhere(median.default)
A single object matching ‘median.default’ was found
It was found in the following places
package:stats
registered S3 method for median from namespace stats
namespace:stats
with value
function (x, na.rm = FALSE)
{
if (is.factor(x) || is.data.frame(x))
stop("need numeric data")
if (length(names(x)))
names(x) <- NULL
if (na.rm)
x <- x[!is.na(x)]
else if (any(is.na(x)))
return(x[FALSE][NA])
n <- length(x)
if (n == 0L)
return(x[FALSE][NA])
half <- (n + 1L)%/%2L
if (n%%2L == 1L)
sort(x, partial = half)[half]
else mean(sort(x, partial = half + 0L:1L)[half + 0L:1L])
}
<bytecode: 0x3c8f828>
<environment: namespace:stats>
</syntaxhighlight>