title: How to read MNIST database in R?
body: <p>I'm currently working on a case study for which I need to work on the <a href="http://yann.lecun.com/exdb/mnist/" rel="noreferrer"><em>MNIST database</em></a>.<br>
  The files in <a href="http://yann.lecun.com/exdb/mnist/" rel="noreferrer">this site</a> are said to be in IDX file format. I tried to take a look at these files using basic text editors like notepad and wordpad, but no luck there.<br>
  Expecting that they would be in the high endian format, I tried the following:</p>
  
  <pre><code>to.read = file("t10k-images.idx3-ubyte", "rb")
  readBin(to.read, integer(), n=100, endian = "high")
  </code></pre>
  
  <p>I got some numbers as output, but none of them made any sense to me.</p>
  
  <p>Can anyone please explain how to read the MNIST database files in R and how to interpret those numbers? Thanks.</p>