The silhouette index of object i is calculated by
$$si(i)=\frac{b_i-a_i}{max(a_i, b_i)}$$
where \(a_i\) is the average distance of object i to all objects
within the cluster, and \(b_i\) is the average distance of object i
to all objects within the nearest cluster.
The idmedoid argument corresponds to the idcluster argument.
If the length of idmedoid is 3, for example, the idcluster has
to have 3 unique memberships, or it returns Error otherwise. The
length of the idcluster has also to be equal to n
(the number of objects).
References
P. J. Rousseeuw. 1987 Silhouettes: a graphical aid to
the interpretation and validation of cluster analysis.
Journal of Computational and Applied Mathematics, vol. 20, pp. 53-65