diff --git a/DESCRIPTION b/DESCRIPTION index 273cf953..a607b2b0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 0.9.0.9009 -Date: 2020-01-08 +Version: 0.9.0.9010 +Date: 2020-01-15 Title: Antimicrobial Resistance Analysis Authors@R: c( person(role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index ba66451f..8a8235c2 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,5 @@ -# AMR 0.9.0.9009 -## Last updated: 08-Jan-2020 +# AMR 0.9.0.9010 +## Last updated: 15-Jan-2020 ### Changes * Speed improvement for `as.mo()` (and consequently all `mo_*` functions that use `as.mo()` internally), especially for the *G. species* format (G for genus), like *E. coli* and *K penumoniae* @@ -13,6 +13,7 @@ ### Other * Add a `CITATION` file +* Full support for the upcoming R 4.0 # AMR 0.9.0 diff --git a/data-raw/country_analysis.R b/data-raw/country_analysis.R index ccca4b2f..09054c4f 100644 --- a/data-raw/country_analysis.R +++ b/data-raw/country_analysis.R @@ -26,7 +26,7 @@ library(maps) library(httr) GET_df <- function(ip) { - ip <- paste0("https://ipinfo.io/", ip, "?token=089aa7765ee912") + ip <- paste0("https://ipinfo.io/", ip, "?token=", ipinfo_token) result <- ip %>% GET() stop_for_status(result) result %>% @@ -57,6 +57,8 @@ for (i in 2:length(unique_ip)) { bind_rows(GET_df(unique_ip[i])) } +ip_tbl.bak <- ip_tbl + # how many? n_distinct(ip_tbl$country) @@ -90,6 +92,9 @@ countries_geometry <- sf::st_as_sf(map('world', plot = FALSE, fill = TRUE)) %>% not_antarctica = as.integer(ID != "Antarctica"), countries_name = ifelse(included == 1, ID, NA)) +# how many? +countries_geometry %>% filter(included == 1) %>% nrow() + countries_plot <- ggplot(countries_geometry) + geom_sf(aes(fill = included, colour = not_antarctica), size = 0.25, @@ -107,7 +112,9 @@ countries_plot_mini$data <- countries_plot_mini$data %>% filter(ID != "Antarctic countries_plot_mini <- countries_plot_mini + scale_colour_gradient(low = "#81899B", high = "#81899B") countries_plot_big <- countries_plot + labs(title = tools::toTitleCase("Countries where the AMR package for R was downloaded from"), - subtitle = paste0("Between March 2018 (first release) and ", format(Sys.Date(), "%B %Y"), ". The dots denote visitors on our website https://gitlab.io/msberends/AMR.")) + + subtitle = paste0("Between March 2018 (first release) and ", format(Sys.Date(), "%B %Y"), "." #, + #"The dots denote visitors on our website https://gitlab.io/msberends/AMR." + )) + theme(plot.title = element_text(size = 16, hjust = 0.5), plot.subtitle = element_text(size = 12, hjust = 0.5)) + geom_text(aes(x = -170, @@ -117,12 +124,12 @@ countries_plot_big <- countries_plot + paste(countries_name[!is.na(countries_name)], collapse = ", ")), 200)), hjust = 0, - size = 4) + - # points of visitors - geom_point(data = ip_tbl, - aes(x = x, y = y), - size = 1, - colour = "#81899B") + size = 4) # + + # # points of visitors + # geom_point(data = ip_tbl, + # aes(x = x, y = y), + # size = 1, + # colour = "#81899B") # main website page ggsave("pkgdown/logos/countries.png", @@ -143,6 +150,14 @@ ggsave("pkgdown/logos/countries_large.png", # Gibberish --------------------------------------------------------------- + +data %>% + left_join(ip_tbl, by = c("ipaddress" = "ip")) %>% + group_by(country = countrycode::countrycode(country, + origin = 'iso2c', + destination = 'country.name')) %>% + summarise(first = min(timestamp_server)) %>% + arrange(desc(first)) # # p1 <- data %>% # group_by(country) %>% diff --git a/docs/404.html b/docs/404.html index 30b5159c..ede234b2 100644 --- a/docs/404.html +++ b/docs/404.html @@ -84,7 +84,7 @@ AMR (for R) - 0.9.0.9009 + 0.9.0.9010 diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index ce422108..81c24006 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -84,7 +84,7 @@ AMR (for R) - 0.9.0.9009 + 0.9.0.9010 diff --git a/docs/articles/index.html b/docs/articles/index.html index 3f33fc1c..17734c93 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -84,7 +84,7 @@ AMR (for R) - 0.9.0.9009 + 0.9.0.9010 diff --git a/docs/authors.html b/docs/authors.html index eb17b5d9..9d17f4d4 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -84,7 +84,7 @@ AMR (for R) - 0.9.0.9009 + 0.9.0.9010 diff --git a/docs/countries.png b/docs/countries.png index b854f968..7b9da82d 100644 Binary files a/docs/countries.png and b/docs/countries.png differ diff --git a/docs/countries_large.png b/docs/countries_large.png index f02717b8..a781c0fd 100644 Binary files a/docs/countries_large.png and b/docs/countries_large.png differ diff --git a/docs/index.html b/docs/index.html index 486cc9f2..7d515a00 100644 --- a/docs/index.html +++ b/docs/index.html @@ -45,7 +45,7 @@ AMR (for R) - 0.9.0.9009 + 0.9.0.9010 diff --git a/docs/news/index.html b/docs/news/index.html index bc850f50..f934407a 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -84,7 +84,7 @@ AMR (for R) - 0.9.0.9009 + 0.9.0.9010 @@ -231,13 +231,13 @@ -
+

-AMR 0.9.0.9009 Unreleased +AMR 0.9.0.9010 Unreleased

-
+

-Last updated: 08-Jan-2020 +Last updated: 15-Jan-2020

@@ -263,6 +263,7 @@ Other

  • Add a CITATION file
  • +
  • Full support for the upcoming R 4.0
@@ -1426,7 +1427,7 @@ Using as.mo(..., allow_uncertain = 3)

Contents

diff --git a/docs/reference/as.ab.html b/docs/reference/as.ab.html index 9d1fcb9d..42fa5bf3 100644 --- a/docs/reference/as.ab.html +++ b/docs/reference/as.ab.html @@ -85,7 +85,7 @@ AMR (for R) - 0.9.0.9009 + 0.9.0.9010
diff --git a/docs/reference/index.html b/docs/reference/index.html index f7cb2416..fbf1efaa 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -84,7 +84,7 @@ AMR (for R) - 0.9.0.9009 + 0.9.0.9010
diff --git a/pkgdown/logos/countries.png b/pkgdown/logos/countries.png index b854f968..7b9da82d 100644 Binary files a/pkgdown/logos/countries.png and b/pkgdown/logos/countries.png differ diff --git a/pkgdown/logos/countries_large.png b/pkgdown/logos/countries_large.png index f02717b8..a781c0fd 100644 Binary files a/pkgdown/logos/countries_large.png and b/pkgdown/logos/countries_large.png differ