Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

loop over all

  • Loading branch information...
commit 81dcfdb4dfbb51f4655f27a81f4217b983452153 1 parent c435b57
@cboettig authored
Showing with 11 additions and 6 deletions.
  1. +11 −6 fishphotos.R
View
17 fishphotos.R
@@ -80,11 +80,16 @@ get_metadata <- function(node, base ="http://pbs.bishopmuseum.org/images/JER/",
}
-family <- "Labridae"
-pages <- get_fish_pages(family)
-metadata <- get_metadata(pages)
-out <- data.frame(lapply(metadata, function(x) as.character(x)))
-write.csv(out, paste(family, ".csv", sep=""))
-download_images(pages)
+require(rfishbase)
+data(fishbase)
+families <- unique(fish_names(fish.data, "Family"))
+for(family in families){
+ pages <- get_fish_pages(family)
+ metadata <- get_metadata(pages)
+ out <- data.frame(lapply(metadata, function(x) as.character(x)))
+ write.csv(out, paste(family, ".csv", sep=""))
+ download_images(pages)
+}
+## Consider plotting on a map? http://cran.r-project.org/web/packages/RgoogleMaps/vignettes/RgoogleMaps-intro.pdf
Please sign in to comment.
Something went wrong with that request. Please try again.