mirror of
https://github.com/msberends/AMR.git
synced 2024-12-25 18:46:11 +01:00
fix for joins
This commit is contained in:
parent
75fe4d401f
commit
e25dd0e282
1
NEWS.md
1
NEWS.md
@ -40,6 +40,7 @@
|
||||
* Edited `ggplot_rsi` and `geom_rsi` so they can cope with `count_df`. The new `fun` parameter has value `portion_df` at default, but can be set to `count_df`.
|
||||
* Fix for `ggplot_rsi` when the `ggplot2` package was not loaded
|
||||
* Added possibility to set any parameter to `geom_rsi` (and `ggplot_rsi`) so you can set your own preferences
|
||||
* Fix for joins, where predefined suffices would not be honoured
|
||||
* Support for types list and matrix for `freq`
|
||||
```r
|
||||
my_matrix = with(septic_patients, matrix(c(age, sex), ncol = 2))
|
||||
|
@ -37,7 +37,7 @@ inner_join_microorganisms <- function(x, by = 'mo', suffix = c("2", ""), ...) {
|
||||
joinby <- by
|
||||
}
|
||||
join <- suppressWarnings(
|
||||
dplyr::inner_join(x = x, y = AMR::microorganisms, by = joinby, suffix = c("2", ""), ...)
|
||||
dplyr::inner_join(x = x, y = AMR::microorganisms, by = joinby, suffix = suffix, ...)
|
||||
)
|
||||
if (nrow(join) > nrow(x)) {
|
||||
warning('the newly joined tbl contains ', nrow(join) - nrow(x), ' rows more that its original')
|
||||
@ -59,7 +59,7 @@ left_join_microorganisms <- function(x, by = 'mo', suffix = c("2", ""), ...) {
|
||||
joinby <- by
|
||||
}
|
||||
join <- suppressWarnings(
|
||||
dplyr::left_join(x = x, y = AMR::microorganisms, by = joinby, suffix = c("2", ""), ...)
|
||||
dplyr::left_join(x = x, y = AMR::microorganisms, by = joinby, suffix = suffix, ...)
|
||||
)
|
||||
if (nrow(join) > nrow(x)) {
|
||||
warning('the newly joined tbl contains ', nrow(join) - nrow(x), ' rows more that its original')
|
||||
@ -81,7 +81,7 @@ right_join_microorganisms <- function(x, by = 'mo', suffix = c("2", ""), ...) {
|
||||
joinby <- by
|
||||
}
|
||||
join <- suppressWarnings(
|
||||
dplyr::right_join(x = x, y = AMR::microorganisms, by = joinby, suffix = c("2", ""), ...)
|
||||
dplyr::right_join(x = x, y = AMR::microorganisms, by = joinby, suffix = suffix, ...)
|
||||
)
|
||||
if (nrow(join) > nrow(x)) {
|
||||
warning('the newly joined tbl contains ', nrow(join) - nrow(x), ' rows more that its original')
|
||||
@ -103,7 +103,7 @@ full_join_microorganisms <- function(x, by = 'mo', suffix = c("2", ""), ...) {
|
||||
joinby <- by
|
||||
}
|
||||
join <- suppressWarnings(
|
||||
dplyr::full_join(x = x, y = AMR::microorganisms, by = joinby, suffix = c("2", ""), ...)
|
||||
dplyr::full_join(x = x, y = AMR::microorganisms, by = joinby, suffix = suffix, ...)
|
||||
)
|
||||
if (nrow(join) > nrow(x)) {
|
||||
warning('the newly joined tbl contains ', nrow(join) - nrow(x), ' rows more that its original')
|
||||
|
Loading…
Reference in New Issue
Block a user