title: Check if there is a newer version of my local file in Github, with R
body: <p>In short: I need to get the date of last change in a file hosted on Github.</p>
  
  <p>In long: given that in Github I have a file (an R workspace) that once in a while is updated, I would like to create a function in R that checks if my local file is older than the one in the repo (if you're curious, my motivation is exposed at the end of this post). <a href="https://github.com/jumanbar/Curso-R/blob/master/ejercicios-de-programacion/rep-3/datos" rel="nofollow noreferrer">This is the file</a> I'm talking about.</p>
  
  <p>In principle it should be somewhat easy, since every file has a <a href="https://github.com/jumanbar/Curso-R/commits/master/ejercicios-de-programacion/rep-3/datos" rel="nofollow noreferrer">history page</a> associated with it, but my knowledge is far too poor to know what to do with this. Also, <a href="https://stackoverflow.com/questions/14865946/how-to-check-a-github-file-in-text-version-with-php">this Q</a> seems to hint at some way of doing what I want using php, but that's terra incognita for me really, so I don't know if it could help in any way.</p>
  
  <p>So, as I said in the short version of this post, I need to find a way to retrieve the date of the last commit for this file. I can find some way to compare it to the commit date of my local file afterwards.</p>
  
  <p>Thanks in advance,
  Juan</p>
  
  <p><em>motivation</em>: I'm working in a an online course in R basics which uses a system for self-checking if solutions of exercises are correct (i.e.: students can check their results instantly). This system uses a file with functions and data that is regularly updated because I often find bugs and new problems. So my goal is to have a function to tell the students if there is a newer file available. It would also be neat to find a way to download it and replace the older, but that is secondary now.</p>