@@ -42,17 +42,17 @@ getFiat <- function(country = NULL, state = NULL, county = NULL, fip = NULL) {
4242if (! is.null(country )) {
4343countries <- rnaturalearth :: ne_countries(returnclass = " sf" )
4444
45- region <- tolower(country )
46- region <- gsub(" south" ," southern" ,region )
47- region <- gsub(" australia" ," oceania" ,region )
48- region <- gsub(" north" ," northern" ,region )
49- region <- gsub(" east" ," eastern" ,region )
50- region <- gsub(" west" ," western" ,region )
51-
52- region <- unlist(c(
53- sapply(region ,.find ,vec = countries $ subregion ,full = countries $ name ),
54- sapply(region ,.find ,vec = countries $ continent ,full = countries $ name )
55- ))
45+ region1 <- tolower(country )
46+ region2 <- gsub(" south" ," southern" ,region )
47+ region2 <- gsub(" australia" ," oceania" ,region )
48+ region2 <- gsub(" north" ," northern" ,region )
49+ region2 <- gsub(" east" ," eastern" ,region )
50+ region2 <- gsub(" west" ," western" ,region )
51+
52+ region <- unique( unlist(c(
53+ sapply(c( region1 , region2 ) ,.find ,vec = countries $ subregion ,full = countries $ name ),
54+ sapply(c( region1 , region2 ) ,.find ,vec = countries $ continent ,full = countries $ name )
55+ )))
5656
5757map0 <- countries [countries $ name %in% region , ]
5858