Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I would like to get a list of all the files available at this address: http://www1.ncdc.noaa.gov/pub/data/cmb/drought/weekly-palmers/2005/ (publicly available data from the NOAA).

It would be some sort of "list.files" for the a specific URL. I started to take a look at RCurl but all I could get was the HTML code of the URL.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
763 views
Welcome To Ask or Share your Answers For Others

1 Answer

In this case you can simply use readHTMLTable:

readHTMLTable("http://www1.ncdc.noaa.gov/pub/data/cmb/drought/weekly-palmers/2005/", 
              skip.rows=1:2)[[1]]$Name -> file.list

Then to create a list of paths:

paste("http://www1.ncdc.noaa.gov/pub/data/cmb/drought/weekly-palmers/2005/", 
      file.list[!is.na(file.list)], sep="") -> path.list

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...