2

I wanted to display in R (without downloading to my computer) .nc files from a server with free access on the internet. I used this code below, but I can't find a good command to read all the files. Can someone help me to improve my code please!

url <- "https://www.ncei.noaa.gov/data/avhrr-land-normalized-difference-vegetation-index/access/1981/"
f="*.nc"
if (!file.exists(f)) download.file(file.path(url, f), f, mode="wb")



trying URL 'https://www.ncei.noaa.gov/data/avhrr-land-normalized-difference-vegetation-index/access/1981//*.nc'
Error in download.file(file.path(url, f), f, mode = "wb") : 
  cannot open URL 'https://www.ncei.noaa.gov/data/avhrr-land-normalized-difference-vegetation-index/access/1981//*.nc'
In addition: Warning message:
In download.file(file.path(url, f), f, mode = "wb") :
  cannot open URL 'https://www.ncei.noaa.gov/data/avhrr-land-normalized-difference-vegetation-index/access/1981//*.nc': HTTP status was '404 Not Found'
tazrart
  • 167
  • 1
  • 15
  • Indeed, I wanted to display under R all the images in the 1981 folder! is there any idea please! – tazrart Feb 12 '20 at 07:49

0 Answers0