squarely: A special case of the widely adverb for creating tidy
square matrices
Description
A special case of widely. Used to pre-prepare and
post-tidy functions that take an m x n (m items, n features)
matrix and return an m x m (item x item) matrix, such as a
distance or correlation matrix.
Usage
squarely(.f, diag = FALSE, upper = TRUE, ...)
squarely_(.f, diag = FALSE, upper = TRUE, ...)
Arguments
.f
Function to wrap
diag
Whether to include diagonal (i = j) in output
upper
Whether to include upper triangle, which may be
duplicated
...
Extra arguments passed on to widely
Value
Returns a function that takes at least four arguments: