title: Resizing image in R
body: <p>I am trying to work with some image data in R, and cannot figure out how to resize the images I have to ensure they are all the same size.</p>
  
  <p>In Python, I approached this problem as follows:</p>
  
  <pre><code>from PIL import Image
  import numpy as np
  
  size = (100, 100)
  img = Image.open(filename)
  img = img.resize(size)
  img = np.array(img.getdata())
  </code></pre>
  
  <p>In R, I've been unable to locate a library that would accomplish the same thing.
  The farthest I've been able to get is:</p>
  
  <pre><code>library(jpeg)
  
  img &lt;- readJPEG(filename)
  # Need something here to resize
  img &lt;- as.matrix(img)
  </code></pre>
  
  <p>The easiest approach would be a library like Pillow that I could call on, but as I said, I can't seem to find anything.</p>
  
  <p>Thanks,</p>