title: I am trying to make an interactive map using leafletR package according to a ZevRoss blog. But there is an error in the code
body: <p>The ZevRoss blog is as follow:
  <a href="http://zevross.com/blog/2014/04/11/using-r-to-quickly-create-an-interactive-online-map-using-the-leafletr-package/" rel="nofollow">http://zevross.com/blog/2014/04/11/using-r-to-quickly-create-an-interactive-online-map-using-the-leafletr-package/</a></p>
  
  <p>The code with error is: </p>
  
  <pre><code># ----- Write data to GeoJSON
  leafdat&lt;-paste(downloaddir, "/", filename, ".geojson", sep="") 
  writeOGR(subdat, leafdat, layer="", driver="GeoJSON")
  </code></pre>
  
  <p>And the error is: </p>
  
  <blockquote>
    <p>Error in writeOGR(subdat, leafdat, layer = "", driver = "GeoJSON") :<br>
    GDAL Error 3: Cannot open file 'd:/Leaflet/County_2010Census_DP1.geojson'</p>
  </blockquote>
  
  <p>Because I am a freshman in R, I searched for this problem a lot and didn't get any good answer.</p>
  
  <p>I am using Rstudio R version 3.1.1(2014-07-10) on windows 7 32bit.
  My rgdal version is 0.9-1.</p>
  
  <p>The other code in the blog runs successfully, this sentence seems to be the only difficult point.</p>