usps: Load USPS handwritten digits data

uspsR Documentation

Load USPS handwritten digits data

Description

The well-known USPS handwritten digits from "0" to "9". Though the original version of each digit is given as a 16\times 16 matrix of grayscale image, it is convention to vectorize it. For each digit, 1100 examples are given.

Usage

data(usps)

Format

a named list containing

data

an (11000\times 256) matrix where each row is a number.

label

(factor) a length-11000 class label in 0,1,…,9.

Examples


# load the data
data(usps)

# visualize
opar <- par(no.readonly=TRUE, mfrow=c(1,3), pty="s")
image(t(matrix(usps$data[4400,],nrow=16)[16:1,])) # last of digit 4
image(t(matrix(usps$data[9900,],nrow=16)[16:1,])) # last of digit 9
image(t(matrix(usps$data[6600,],nrow=16)[16:1,])) # last of digit 6
par(opar)



Rdimtools documentation built on Dec. 28, 2022, 1:44 a.m.