1
0
mirror of https://github.com/msberends/AMR.git synced 2024-12-26 18:46:13 +01:00

(v0.9.0.9010) Support R 4.0

This commit is contained in:
dr. M.S. (Matthijs) Berends 2020-01-15 15:24:08 +01:00
parent 64f5ceef03
commit 895e97c310
16 changed files with 43 additions and 26 deletions

View File

@ -1,6 +1,6 @@
Package: AMR Package: AMR
Version: 0.9.0.9009 Version: 0.9.0.9010
Date: 2020-01-08 Date: 2020-01-15
Title: Antimicrobial Resistance Analysis Title: Antimicrobial Resistance Analysis
Authors@R: c( Authors@R: c(
person(role = c("aut", "cre"), person(role = c("aut", "cre"),

View File

@ -1,5 +1,5 @@
# AMR 0.9.0.9009 # AMR 0.9.0.9010
## <small>Last updated: 08-Jan-2020</small> ## <small>Last updated: 15-Jan-2020</small>
### Changes ### 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* * 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 ### Other
* Add a `CITATION` file * Add a `CITATION` file
* Full support for the upcoming R 4.0
# AMR 0.9.0 # AMR 0.9.0

View File

@ -26,7 +26,7 @@ library(maps)
library(httr) library(httr)
GET_df <- function(ip) { GET_df <- function(ip) {
ip <- paste0("https://ipinfo.io/", ip, "?token=089aa7765ee912") ip <- paste0("https://ipinfo.io/", ip, "?token=", ipinfo_token)
result <- ip %>% GET() result <- ip %>% GET()
stop_for_status(result) stop_for_status(result)
result %>% result %>%
@ -57,6 +57,8 @@ for (i in 2:length(unique_ip)) {
bind_rows(GET_df(unique_ip[i])) bind_rows(GET_df(unique_ip[i]))
} }
ip_tbl.bak <- ip_tbl
# how many? # how many?
n_distinct(ip_tbl$country) 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"), not_antarctica = as.integer(ID != "Antarctica"),
countries_name = ifelse(included == 1, ID, NA)) countries_name = ifelse(included == 1, ID, NA))
# how many?
countries_geometry %>% filter(included == 1) %>% nrow()
countries_plot <- ggplot(countries_geometry) + countries_plot <- ggplot(countries_geometry) +
geom_sf(aes(fill = included, colour = not_antarctica), geom_sf(aes(fill = included, colour = not_antarctica),
size = 0.25, 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_mini <- countries_plot_mini + scale_colour_gradient(low = "#81899B", high = "#81899B")
countries_plot_big <- countries_plot + countries_plot_big <- countries_plot +
labs(title = tools::toTitleCase("Countries where the AMR package for R was downloaded from"), 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), theme(plot.title = element_text(size = 16, hjust = 0.5),
plot.subtitle = element_text(size = 12, hjust = 0.5)) + plot.subtitle = element_text(size = 12, hjust = 0.5)) +
geom_text(aes(x = -170, geom_text(aes(x = -170,
@ -117,12 +124,12 @@ countries_plot_big <- countries_plot +
paste(countries_name[!is.na(countries_name)], collapse = ", ")), paste(countries_name[!is.na(countries_name)], collapse = ", ")),
200)), 200)),
hjust = 0, hjust = 0,
size = 4) + size = 4) # +
# points of visitors # # points of visitors
geom_point(data = ip_tbl, # geom_point(data = ip_tbl,
aes(x = x, y = y), # aes(x = x, y = y),
size = 1, # size = 1,
colour = "#81899B") # colour = "#81899B")
# main website page # main website page
ggsave("pkgdown/logos/countries.png", ggsave("pkgdown/logos/countries.png",
@ -143,6 +150,14 @@ ggsave("pkgdown/logos/countries_large.png",
# Gibberish --------------------------------------------------------------- # 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 %>% # p1 <- data %>%
# group_by(country) %>% # group_by(country) %>%

View File

@ -84,7 +84,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="https://msberends.gitlab.io/AMR/index.html">AMR (for R)</a> <a class="navbar-link" href="https://msberends.gitlab.io/AMR/index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9009</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9010</span>
</span> </span>
</div> </div>

View File

@ -84,7 +84,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a> <a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9009</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9010</span>
</span> </span>
</div> </div>

View File

@ -84,7 +84,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9009</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9010</span>
</span> </span>
</div> </div>

View File

@ -84,7 +84,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a> <a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9009</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9010</span>
</span> </span>
</div> </div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

@ -45,7 +45,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a> <a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9009</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9010</span>
</span> </span>
</div> </div>

View File

@ -84,7 +84,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9009</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9010</span>
</span> </span>
</div> </div>
@ -231,13 +231,13 @@
</div> </div>
<div id="amr-0-9-0-9009" class="section level1"> <div id="amr-0-9-0-9010" class="section level1">
<h1 class="page-header"> <h1 class="page-header">
<a href="#amr-0-9-0-9009" class="anchor"></a>AMR 0.9.0.9009<small> Unreleased </small> <a href="#amr-0-9-0-9010" class="anchor"></a>AMR 0.9.0.9010<small> Unreleased </small>
</h1> </h1>
<div id="last-updated-08-jan-2020" class="section level2"> <div id="last-updated-15-jan-2020" class="section level2">
<h2 class="hasAnchor"> <h2 class="hasAnchor">
<a href="#last-updated-08-jan-2020" class="anchor"></a><small>Last updated: 08-Jan-2020</small> <a href="#last-updated-15-jan-2020" class="anchor"></a><small>Last updated: 15-Jan-2020</small>
</h2> </h2>
<div id="changes" class="section level3"> <div id="changes" class="section level3">
<h3 class="hasAnchor"> <h3 class="hasAnchor">
@ -263,6 +263,7 @@
<a href="#other" class="anchor"></a>Other</h3> <a href="#other" class="anchor"></a>Other</h3>
<ul> <ul>
<li>Add a <code>CITATION</code> file</li> <li>Add a <code>CITATION</code> file</li>
<li>Full support for the upcoming R 4.0</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -1426,7 +1427,7 @@ Using <code><a href="../reference/as.mo.html">as.mo(..., allow_uncertain = 3)</a
<div id="tocnav"> <div id="tocnav">
<h2>Contents</h2> <h2>Contents</h2>
<ul class="nav nav-pills nav-stacked"> <ul class="nav nav-pills nav-stacked">
<li><a href="#amr-0-9-0-9009">0.9.0.9009</a></li> <li><a href="#amr-0-9-0-9010">0.9.0.9010</a></li>
<li><a href="#amr-0-9-0">0.9.0</a></li> <li><a href="#amr-0-9-0">0.9.0</a></li>
<li><a href="#amr-0-8-0">0.8.0</a></li> <li><a href="#amr-0-8-0">0.8.0</a></li>
<li><a href="#amr-0-7-1">0.7.1</a></li> <li><a href="#amr-0-7-1">0.7.1</a></li>

View File

@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9009</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9010</span>
</span> </span>
</div> </div>

View File

@ -85,7 +85,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9009</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9010</span>
</span> </span>
</div> </div>

View File

@ -84,7 +84,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9009</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">0.9.0.9010</span>
</span> </span>
</div> </div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB