show_digit: Show image of grayscale grid

show_digitR Documentation

Show image of grayscale grid

Description

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.

Value

The desired image representation of the digit.

Author(s)

Keefe Murphy - <keefe.murphy@mu.ie>

See Also

USPSdigits, show_IMIFA_digit, mat2cols, plot_cols

Examples

data(USPSdigits)

# Plot the first digit
show_digit(USPSdigits$train[1,-1])

# Visualise the overall mean
show_digit(colMeans(USPSdigits$train[,-1]))

IMIFA documentation built on Dec. 28, 2022, 1:58 a.m.