Plots an image of a grayscale grid representation of a digit.
Usage
show_digit(dat,
col = NULL,
...)
Arguments
dat
A matrix or data.frame with the same number of rows and columns (or a vector which can be coerced to such a format), representing a grayscale map of a single digit.
col
The colour scale to be used. Defaults to grey(seq(1, 0, length = ncol(dat))).
...
Additional arguments to be passed to mat2cols and/or plot_cols (e.g. na.col) when dat is a matrix or image when dat is a vector.
# NOT RUN {data(USPSdigits)
# Plot the first digitshow_digit(USPSdigits$train[1,-1])
# Visualise the overall meanshow_digit(colMeans(USPSdigits$train[,-1]))
# }