Distances between subjects are based on Gower's general similarity coefficient with an extension of Podani for ordinal variables, see gowdis. In the case that all variables are quantitative, Euclidean distances are used. Then a dendrogram is derived by standard hierarchical clustering (hclust with agglomeration method = "ward.D2" by default).
References
Gower J (1971). A general coefficient of similarity and some of its properties. Biometrics, 27:857-871.
Podani J (1999). Extending Gower's general coefficient of similarity to ordinal characters. Taxon, 48(2):331-340.