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

(v1.2.0.9002) fix for joins

This commit is contained in:
dr. M.S. (Matthijs) Berends 2020-06-03 14:33:55 +02:00
parent 5dc4c96b7d
commit 2c8d600914
11 changed files with 27 additions and 19 deletions

View File

@ -1,5 +1,5 @@
Package: AMR Package: AMR
Version: 1.2.0.9001 Version: 1.2.0.9002
Date: 2020-06-03 Date: 2020-06-03
Title: Antimicrobial Resistance Analysis Title: Antimicrobial Resistance Analysis
Authors@R: c( Authors@R: c(

View File

@ -1,4 +1,4 @@
# AMR 1.2.0.9001 # AMR 1.2.0.9002
## <small>Last updated: 03-Jun-2020</small> ## <small>Last updated: 03-Jun-2020</small>
### Changed ### Changed

View File

@ -57,7 +57,7 @@ inner_join_microorganisms <- function(x, by = NULL, suffix = c("2", ""), ...) {
check_dataset_integrity() check_dataset_integrity()
check_groups_before_join(x, "inner_join_microorganisms") check_groups_before_join(x, "inner_join_microorganisms")
checked <- joins_check_df(x, by) checked <- joins_check_df(x, by)
x_class <- class(x) x_class <- get_prejoined_class(x)
x <- checked$x x <- checked$x
by <- checked$by by <- checked$by
join <- suppressWarnings( join <- suppressWarnings(
@ -76,7 +76,7 @@ left_join_microorganisms <- function(x, by = NULL, suffix = c("2", ""), ...) {
check_dataset_integrity() check_dataset_integrity()
check_groups_before_join(x, "left_join_microorganisms") check_groups_before_join(x, "left_join_microorganisms")
checked <- joins_check_df(x, by) checked <- joins_check_df(x, by)
x_class <- class(x) x_class <- get_prejoined_class(x)
x <- checked$x x <- checked$x
by <- checked$by by <- checked$by
join <- suppressWarnings( join <- suppressWarnings(
@ -95,7 +95,7 @@ right_join_microorganisms <- function(x, by = NULL, suffix = c("2", ""), ...) {
check_dataset_integrity() check_dataset_integrity()
check_groups_before_join(x, "right_join_microorganisms") check_groups_before_join(x, "right_join_microorganisms")
checked <- joins_check_df(x, by) checked <- joins_check_df(x, by)
x_class <- class(x) x_class <- get_prejoined_class(x)
x <- checked$x x <- checked$x
by <- checked$by by <- checked$by
join <- suppressWarnings( join <- suppressWarnings(
@ -114,7 +114,7 @@ full_join_microorganisms <- function(x, by = NULL, suffix = c("2", ""), ...) {
check_dataset_integrity() check_dataset_integrity()
check_groups_before_join(x, "full_join_microorganisms") check_groups_before_join(x, "full_join_microorganisms")
checked <- joins_check_df(x, by) checked <- joins_check_df(x, by)
x_class <- class(x) x_class <- get_prejoined_class(x)
x <- checked$x x <- checked$x
by <- checked$by by <- checked$by
join <- suppressWarnings( join <- suppressWarnings(
@ -132,7 +132,7 @@ full_join_microorganisms <- function(x, by = NULL, suffix = c("2", ""), ...) {
semi_join_microorganisms <- function(x, by = NULL, ...) { semi_join_microorganisms <- function(x, by = NULL, ...) {
check_dataset_integrity() check_dataset_integrity()
check_groups_before_join(x, "semi_join_microorganisms") check_groups_before_join(x, "semi_join_microorganisms")
x_class <- class(x) x_class <- get_prejoined_class(x)
checked <- joins_check_df(x, by) checked <- joins_check_df(x, by)
x <- checked$x x <- checked$x
by <- checked$by by <- checked$by
@ -149,7 +149,7 @@ anti_join_microorganisms <- function(x, by = NULL, ...) {
check_dataset_integrity() check_dataset_integrity()
check_groups_before_join(x, "anti_join_microorganisms") check_groups_before_join(x, "anti_join_microorganisms")
checked <- joins_check_df(x, by) checked <- joins_check_df(x, by)
x_class <- class(x) x_class <- get_prejoined_class(x)
x <- checked$x x <- checked$x
by <- checked$by by <- checked$by
join <- suppressWarnings( join <- suppressWarnings(
@ -190,6 +190,14 @@ joins_check_df <- function(x, by) {
by = joinby) by = joinby)
} }
get_prejoined_class <- function(x) {
if (is.data.frame(x)) {
class(x)
} else {
"data.frame"
}
}
check_groups_before_join <- function(x, fn) { check_groups_before_join <- function(x, fn) {
if (is.data.frame(x) && !is.null(attributes(x)$groups)) { if (is.data.frame(x) && !is.null(attributes(x)$groups)) {
warning("Groups are dropped, since the ", fn, "() function relies on merge() from base R, not on join() from dplyr.", call. = FALSE) warning("Groups are dropped, since the ", fn, "() function relies on merge() from base R, not on join() from dplyr.", call. = FALSE)

View File

@ -81,7 +81,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">1.2.0.9001</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.2.0.9002</span>
</span> </span>
</div> </div>

View File

@ -81,7 +81,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">1.2.0.9001</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.2.0.9002</span>
</span> </span>
</div> </div>

View File

@ -81,7 +81,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">1.2.0.9001</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.2.0.9002</span>
</span> </span>
</div> </div>

View File

@ -81,7 +81,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">1.2.0.9001</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.2.0.9002</span>
</span> </span>
</div> </div>

View File

@ -43,7 +43,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">1.2.0.9001</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.2.0.9002</span>
</span> </span>
</div> </div>

View File

@ -81,7 +81,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">1.2.0.9001</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.2.0.9002</span>
</span> </span>
</div> </div>
@ -229,9 +229,9 @@
<small>Source: <a href='https://gitlab.com/msberends/AMR/blob/master/NEWS.md'><code>NEWS.md</code></a></small> <small>Source: <a href='https://gitlab.com/msberends/AMR/blob/master/NEWS.md'><code>NEWS.md</code></a></small>
</div> </div>
<div id="amr-1209001" class="section level1"> <div id="amr-1209002" class="section level1">
<h1 class="page-header" data-toc-text="1.2.0.9001"> <h1 class="page-header" data-toc-text="1.2.0.9002">
<a href="#amr-1209001" class="anchor"></a>AMR 1.2.0.9001<small> Unreleased </small> <a href="#amr-1209002" class="anchor"></a>AMR 1.2.0.9002<small> Unreleased </small>
</h1> </h1>
<div id="last-updated-03-jun-2020" class="section level2"> <div id="last-updated-03-jun-2020" class="section level2">
<h2 class="hasAnchor"> <h2 class="hasAnchor">

View File

@ -10,7 +10,7 @@ articles:
WHONET: WHONET.html WHONET: WHONET.html
benchmarks: benchmarks.html benchmarks: benchmarks.html
resistance_predict: resistance_predict.html resistance_predict: resistance_predict.html
last_built: 2020-06-03T09:44Z last_built: 2020-06-03T12:33Z
urls: urls:
reference: https://msberends.gitlab.io/AMR/reference reference: https://msberends.gitlab.io/AMR/reference
article: https://msberends.gitlab.io/AMR/articles article: https://msberends.gitlab.io/AMR/articles

View File

@ -81,7 +81,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">1.2.0.9001</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.2.0.9002</span>
</span> </span>
</div> </div>