A function to decrease the size of a matrix while attempting to preserve the
original values.
Usage
condense_matrix(m, fun = median)
Arguments
m
A matrix.
fun
A function for summarizing four values that condenses them down to
one value. Default is median.
Value
A matrix with dimensions half the size of the original matrix, where each
value is a summary of the four corresponding values in the original.
Details
This function can be used for image manipulation and is included for
the purpose of making mazes from images. PNG images can be read in as
arrays via png::readPNG and if the image is too big, this funtion
can help get it down to a more manageable size.