A simple R package to download, collate, and load the classic MNIST dataset in R.
You can install mnistR from GitHub with:
# install.packages("devtools")
devtools::install_github("itsrainingdata/mnistR")
Access the data in one line, as quickly as possible:
MNIST <- mnistR::autoloadMNIST()
By default, the data will be saved to the current working directory. This directory can be manually specified via the dest
argument (see Overview).
Download the data to your local drive at /path/to
:
mnistR::downloadMNIST(dest = "/path/to/")
Load the data (after downloading):
mnistR::loadMNIST(dest = "/path/to/")
The result is a list containing two data frames (train
and test
). The labels are stored in the last column, train$y
and test$y
.
The autoloadMNIST
method is simply a wrapper to combine these steps into one method. For even finer grained access, see the methods load_mnist_train
, load_mnist_test
, and the corresponding download
and autoload
methods.
This package is a port of code written by @brendano and @daviddalpiaz. The original code can be found here: