title: Import JSON file from URL into R
body: <p>I've been trying to import a JSON file into R for a while using both the rjson and RJSONIO package, but I can't get it to work. One of the variations of code I used:</p>
  
  <pre><code>json_file &lt;- "http://toolserver.org/~emw/index.php?c=rawdata&amp;m=get_traffic_data&amp;p1=USA&amp;project1=en&amp;from=12/10/2007&amp;to=4/1/2011"
  json_data &lt;- fromJSON(paste(readLines(json_file), collapse=""))
  </code></pre>
  
  <p>This results in an error message:</p>
  
  <pre><code>Error in fromJSON(paste(readLines(json_file), collapse = "")) : 
  unexpected character '&lt;'
  </code></pre>
  
  <p>I think the problem is in the first line of code, because json_file contains the source of the website, not the actual content. I've tried getURL() and getURLContent(), but without any success. Any help would be much appreciated!</p>
  
  <p>Edit: as pointed out by Martin Morgan, the problem seems to be with the URL, not the code!</p>