Gower.dist() code based on analogous function from 'StatMatch' package;
please see this package for the original code and full documentation.
This function computes the Gower's distance (dissimilarity) among units
in a dataset or among observations in two distinct datasets. Columns of
mode numeric will be considered as interval scaled variables; columns of
mode character or class factor will be considered as categorical nominal
variables; columns of class ordered will be considered as categorical
ordinal variables and, columns of mode logical will be considered as
binary asymmetric variables. Missing values (NA) are allowed. If only
data.x is supplied, the dissimilarities between _rows_ of data.x will be
computed.
For 'rngs', in correspondence of non-numeric variables, just put 1 or NA.
When rngs=NULL (default), the range of a numeric variable is estimated by
jointly considering the values for the variable in 'data.x' and those in
'data.y'.
When 'na.rm=TRUE', all missing values (NAs and NaNs) in the result will
be replaced with maximal distance. This is discussable but helps, e.g.,
to bootstrap hierarchical clustering in case if data is rich of NAs.