Skip to content

Commit

Permalink
Merge pull request #72 from randrescastaneda/DEV
Browse files Browse the repository at this point in the history
version 0.2.3
  • Loading branch information
randrescastaneda authored Aug 22, 2024
2 parents a964da9 + f23faa8 commit 15c1e58
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 36 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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.3
Authors@R: c(person(given = "R.Andres",
family = "Castaneda",
email = "[email protected]",
Expand Down Expand Up @@ -41,6 +41,6 @@ Imports:
lifecycle
Depends:
R (>= 2.10)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Roxygen: list(markdown = TRUE)
VignetteBuilder: knitr
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# joyn 0.2.3

* 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.
Expand Down
41 changes: 22 additions & 19 deletions R/joyn-merge.R
Original file line number Diff line number Diff line change
Expand Up @@ -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` ---------
Expand All @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
28 changes: 14 additions & 14 deletions revdep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |<U+0394> |
|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

27 changes: 27 additions & 0 deletions tests/testthat/test-joyn.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))

})

0 comments on commit 15c1e58

Please sign in to comment.