title: Download NASA satellite data using RCurl in R
body: <p>I am trying to download a <code>ncdf</code> file using <code>rCurl</code>. Can anyone provide any advice on why this is not working? </p>
  
  <pre><code>require(RCurl)
  require(ncdf4)
  
  url &lt;- "https://oceandata.sci.gsfc.nasa.gov/MODIS-Aqua/Mapped/Seasonal_Climatology/4km/sst/"
  filename &lt;-"A20021722014263.L3m_SCSU_NSST_sst_4km.nc"
  
  download.file(paste0(url, filename),destfile = paste0("~/Desktop/", filename), method="curl")
  
  setwd("~/Desktop/")
  files&lt;-dir(pattern="*.nc")
  f&lt;-nc_open(files[1])
  </code></pre>
  
  <blockquote>
    <p>Error in R_nc4_open: NetCDF: Unknown file format</p>
    
    <p>Error in nc_open(files[1]) : </p>
    
    <p>Error in nc_open trying to open file A20021722014263.L3m_SCSU_NSST_sst_4km.nc</p>
  </blockquote>