Learn R Programming

readmnist (version 1.0.6)

Read.mnist: Read MNIST Dataset

Description

read and arrange informations from MNIST dataset.

Usage

Read.mnist(filename)

Arguments

filename

filename of a MNIST dataset (example: "t10k-images.idx3-ubyte")

Value

magic_number

the magic_number of file

labels

the labels information from the dataset(if it's a label file)

pic

the images from the dataset, and each row is one image.(if it's a image file)

nrow

the height of a image(if it's a image file)

ncol

the width of a image(if it's a image file)

number

the number of the dataset

itemmarkthe remark of the Info

Details

It will return a list (Info) including all necessary informations. If it's a label file, Info will contain : $magic_number $labels $number $mark(the style of dataset); If it's a image file, Info will contain : $ magic_number $pic(each row is a image) $nrow $ncol $number $mark(the style of dataset); And if it's other invalid file, Info will be empty, and the function will print error messages.

References

https://stackoverflow.com/questions/21521571/how-to-read-mnist-database-in-r

Examples

Run this code
# NOT RUN {
  Info <- Read.mnist(system.file("exdata/t10k-labels.idx1-ubyte", package="readmnist"))
# }

Run the code above in your browser using DataLab