
Last chance! 50% off unlimited learning
Sale ends in
Returns the number of observations (sample size) corresponding to a dissimilarity like object, or equivalently, the number of rows or columns of a matrix when only the lower or upper triangular part (without diagonal) is given.
It is nothing else but the inverse function of
sizeDiss(d)
any R object with length (typically)
a number; length(d) == n(n-1)/2
, NA
otherwise.
dissimilarity.object
and also
as.dist
for class dissimilarity
and
dist
objects which have a Size
attribute.
# NOT RUN {
sizeDiss(1:10)# 5, since 10 == 5 * (5 - 1) / 2
sizeDiss(1:9) # NA
n <- 1:100
stopifnot(n == sapply( n*(n-1)/2, function(n) sizeDiss(logical(n))))
# }
Run the code above in your browser using DataLab