From ec673e480d828c5930f9204e48ecea49a27fbec9 Mon Sep 17 00:00:00 2001 From: "R.Andres Castaneda Aguilar" Date: Wed, 10 Jul 2024 10:59:43 -0400 Subject: [PATCH 1/8] Increment version number to 0.2.2.9000 --- DESCRIPTION | 2 +- NEWS.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index c5228c00..f4cd46b0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: joyn Type: Package Title: Tool for Diagnosis of Tables Joins and Complementary Join Features -Version: 0.2.2 +Version: 0.2.2.9000 Authors@R: c(person(given = "R.Andres", family = "Castaneda", email = "acastanedaa@worldbank.org", diff --git a/NEWS.md b/NEWS.md index b995ceb7..4c34cd75 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,5 @@ +# joyn (development version) + # joyn 0.2.2 * Remove unmasking functions as we realized that they are not necessary. From 0a9f8b016e9033ba023006dcc5f4ea6ba499dd88 Mon Sep 17 00:00:00 2001 From: zander-prinsloo Date: Wed, 31 Jul 2024 23:31:29 -0400 Subject: [PATCH 2/8] filter rows before updating values --- R/joyn-merge.R | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/R/joyn-merge.R b/R/joyn-merge.R index 4eb18490..e0d29686 100644 --- a/R/joyn-merge.R +++ b/R/joyn-merge.R @@ -385,25 +385,6 @@ joyn <- function(x, ) - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Update jn --------- - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - var_use <- NULL - if (isTRUE(update_NAs) || isTRUE(update_values)) { - var_use <- common_vars - } - - if (isTRUE(update_NAs || update_values) & length(var_use) > 0 ) { - - jn <- update_na_values(dt = jn, - var = var_use, - reportvar = reportvar, - suffixes = suffixes, - rep_NAs = update_NAs, - rep_values = update_values - ) - - } #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Filter rows - `keep` --------- @@ -430,6 +411,28 @@ joyn <- function(x, } + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + # Update jn --------- + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var_use <- NULL + if (isTRUE(update_NAs) || isTRUE(update_values)) { + var_use <- common_vars + } + + if (isTRUE(update_NAs || update_values) & length(var_use) > 0 ) { + # filter_var <- jn |> + # fselect(get(reportvar)) + #print(filter_var) + jn <- update_na_values(dt = jn, + var = var_use, + reportvar = reportvar, + suffixes = suffixes, + rep_NAs = update_NAs, + rep_values = update_values + ) + + } + ### common vars ---------- if (isFALSE(keep_common_vars)) { From 2566a8999d09def89f3420aa4448a2ff54178ffe Mon Sep 17 00:00:00 2001 From: zander-prinsloo Date: Wed, 31 Jul 2024 23:31:47 -0400 Subject: [PATCH 3/8] test update vals works for left join, filter rows --- tests/testthat/test-joyn.R | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/testthat/test-joyn.R b/tests/testthat/test-joyn.R index 1a799a19..5ccc2f04 100644 --- a/tests/testthat/test-joyn.R +++ b/tests/testthat/test-joyn.R @@ -855,3 +855,30 @@ test_that("joyn() - input data unchanged", { }) +test_that("update_values still filters rows for left joins", { + + x <- data.frame(id = 1:5, + a = 1:5, + b = 2:6) + y <- data.frame(id = c(1, 11, 2, 12, 5), + a = 11:15, + b = 12:16) + + # for data.table + j1 <- joyn(x = qDT(x), + y = qDT(y), + by = "id", + keep = "left", + update_values = TRUE) + + j2 <- joyn(x = x, + y = y, + by = "id", + keep = "left", + update_values = TRUE) + + expect_true(all(j1$id %in% x$id)) + expect_true(all(j2$id %in% x$id)) + +}) + From 9e4f50de3b28a261f5d9f131cc01f4d3480638a5 Mon Sep 17 00:00:00 2001 From: zander-prinsloo Date: Thu, 1 Aug 2024 09:48:25 -0400 Subject: [PATCH 4/8] Increment version number to 0.2.2.9001 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index f4cd46b0..5134a09f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: joyn Type: Package Title: Tool for Diagnosis of Tables Joins and Complementary Join Features -Version: 0.2.2.9000 +Version: 0.2.2.9001 Authors@R: c(person(given = "R.Andres", family = "Castaneda", email = "acastanedaa@worldbank.org", From 616200f94523b4d43f04200a847a837fd4e5d296 Mon Sep 17 00:00:00 2001 From: "R.Andres Castaneda Aguilar" Date: Sat, 3 Aug 2024 11:11:11 -0400 Subject: [PATCH 5/8] document --- DESCRIPTION | 2 +- NEWS.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index f4cd46b0..aaa87ed8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -41,6 +41,6 @@ Imports: lifecycle Depends: R (>= 2.10) -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 Roxygen: list(markdown = TRUE) VignetteBuilder: knitr diff --git a/NEWS.md b/NEWS.md index 4c34cd75..ecd75d58 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # joyn (development version) +* Fix bug where the left join did not work when updating values and a full join was maintained. + # joyn 0.2.2 * Remove unmasking functions as we realized that they are not necessary. From fcac6419dad23178d4cb1a5368e66d6dbe0f53ac Mon Sep 17 00:00:00 2001 From: "R.Andres Castaneda Aguilar" Date: Sat, 3 Aug 2024 11:24:03 -0400 Subject: [PATCH 6/8] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 36c6a147..55dbeb35 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![CRAN checks](https://badges.cranchecks.info/summary/joyn.svg)](https://cran.r-project.org/web/checks/check_results_joyn.html) [![](https://www.r-pkg.org/badges/version/joyn?color=orange)](https://cran.r-project.org/package=joyn) -[![](https://img.shields.io/badge/devel%20version-0.2.1-blue.svg)](https://github.com/randrescastaneda/joyn) +[![](https://img.shields.io/badge/devel%20version-0.2.2.9001-blue.svg)](https://github.com/randrescastaneda/joyn) [![](https://codecov.io/gh/randrescastaneda/joyn/branch/master/graph/badge.svg)](https://app.codecov.io/gh/randrescastaneda/joyn) [![](https://img.shields.io/badge/lifecycle-maturing-green.svg)](https://lifecycle.r-lib.org/articles/stages.html#maturing) From c8fd227eb09b109471cfa6efddeb05d1a5295078 Mon Sep 17 00:00:00 2001 From: "R.Andres Castaneda Aguilar" Date: Sat, 3 Aug 2024 20:57:26 -0400 Subject: [PATCH 7/8] update readme --- revdep/README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/revdep/README.md b/revdep/README.md index 9ba817c2..ee33d5c9 100644 --- a/revdep/README.md +++ b/revdep/README.md @@ -2,30 +2,30 @@ |field |value | |:--------|:----------------------------------------| -|version |R version 4.3.1 (2023-06-16 ucrt) | -|os |Windows Server 2016 x64 (build 14393) | +|version |R version 4.4.1 (2024-06-14 ucrt) | +|os |Windows 11 x64 (build 22631) | |system |x86_64, mingw32 | |ui |RStudio | |language |(EN) | -|collate |English_United States.1252 | -|ctype |English_United States.1252 | +|collate |English_United States.utf8 | +|ctype |English_United States.utf8 | |tz |America/New_York | -|date |2024-03-29 | -|rstudio |2023.09.1+494 Desert Sunflower (desktop) | +|date |2024-08-03 | +|rstudio |2024.04.2+764 Chocolate Cosmos (desktop) | |pandoc |NA | # Dependencies -|package |old |new | | +|package |old |new |Δ | |:----------|:------|:----------|:--| -|joyn |0.1.4 |0.1.6.9004 |* | -|cli |3.6.2 |3.6.2 | | -|collapse |NA |2.0.11 |* | -|data.table |1.15.2 |1.15.2 | | +|joyn |0.2.2 |0.2.2.9001 |* | +|cli |3.6.3 |3.6.3 | | +|collapse |2.0.15 |2.0.15 | | +|data.table |1.15.4 |1.15.4 | | |glue |1.7.0 |1.7.0 | | -|lifecycle |NA |1.0.4 |* | -|Rcpp |NA |1.0.12 |* | -|rlang |1.1.3 |1.1.3 | | +|lifecycle |1.0.4 |1.0.4 | | +|Rcpp |1.0.13 |1.0.13 | | +|rlang |1.1.4 |1.1.4 | | # Revdeps From f23faa8ccd826a8cf51b74e40d0f3c01fed625b1 Mon Sep 17 00:00:00 2001 From: "R.Andres Castaneda Aguilar" Date: Sat, 3 Aug 2024 20:59:06 -0400 Subject: [PATCH 8/8] Increment version number to 0.2.3 --- DESCRIPTION | 2 +- NEWS.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 8c790a90..ea03dbe2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: joyn Type: Package Title: Tool for Diagnosis of Tables Joins and Complementary Join Features -Version: 0.2.2.9001 +Version: 0.2.3 Authors@R: c(person(given = "R.Andres", family = "Castaneda", email = "acastanedaa@worldbank.org", diff --git a/NEWS.md b/NEWS.md index ecd75d58..28611f83 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# joyn (development version) +# joyn 0.2.3 * Fix bug where the left join did not work when updating values and a full join was maintained.