Skip to content

Commit

Permalink
added some stuff to deal with ambiguous Titles for anopheles rasters,…
Browse files Browse the repository at this point in the history
… '59
  • Loading branch information
Dan Pfeffer committed Feb 21, 2018
1 parent 5e5f01f commit 4b07c70
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion R/listRaster.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ message("Downloading list of available rasters...")
categories <- unname(sapply( X = sapply(layers, function(x){sub("^category:","",grep("^category:",unname(unlist(x[["KeywordList"]])), value = TRUE))}), FUN = function (x) ifelse (is.null (x), NA, x)))



#extract raster metadata from layers list & turn this into dataframe
available_rasters <- data.frame("title"= titles,
"title_extended" = extended_titles,
Expand All @@ -74,6 +73,20 @@ message("Downloading list of available rasters...")
available_rasters <- available_rasters[available_rasters$category == "surfaces",-which(names(available_rasters)=="category")]
available_rasters <- available_rasters[!is.na(available_rasters$raster_code),]


available_rasters$title[x$title== "An. dirus species complex"&grepl("^Moyes", available_rasters$citation)] <- "An. dirus species complex (2016)"
available_rasters$title[x$title== "An. dirus species complex"&grepl("^Sinka", available_rasters$citation)] <- "An. dirus species complex (2011)"

available_rasters$title[x$title== "An. arabiensis Patton, 1905"&grepl("^Wiebe", available_rasters$citation)] <- "An. arabiensis Patton, 1905 (2017)"
available_rasters$title[x$title== "An. arabiensis Patton, 1905"&grepl("^Sinka", available_rasters$citation)] <- "An. arabiensis Patton, 1905 (2010)"

available_rasters$title[x$title== "An. melas Theobald, 1903"&grepl("^Wiebe", available_rasters$citation)] <- "An. melas Theobald, 1903 (2017)"
available_rasters$title[x$title== "An. melas Theobald, 1903"&grepl("^Sinka", available_rasters$citation)] <- "An. melas Theobald, 1903 (2010)"

available_rasters$title[x$title== "An. merus Dönitz, 1902"&grepl("^Wiebe", available_rasters$citation)] <- "An. merus Dönitz, 1902 (2017)"
available_rasters$title[x$title== "An. merus Dönitz, 1902"&grepl("^Sinka", available_rasters$citation)] <- "An. merus Dönitz, 1902 (2010)"


#print out message of long raster names
if(printed == TRUE){
message("Rasters Available for Download: \n ",paste(available_rasters$title, collapse = " \n "))
Expand Down

0 comments on commit 4b07c70

Please sign in to comment.