Skip to content

Commit

Permalink
Merge pull request #9 from randrescastaneda/dev
Browse files Browse the repository at this point in the history
version 0.0.1 submitted to CRAN
  • Loading branch information
randrescastaneda authored Mar 31, 2021
2 parents 8519f5d + 7ac64bf commit 1b1ee87
Show file tree
Hide file tree
Showing 36 changed files with 454 additions and 194 deletions.
6 changes: 6 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@
^pkgdown$
^\.github$
^codecov\.yml$
^revdep$
cran-comments.md

^doc$
^Meta$
^CRAN-RELEASE$
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
.Ruserdata

inst/doc
doc
Meta
2 changes: 2 additions & 0 deletions CRAN-RELEASE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This package was submitted to CRAN on 2021-03-31.
Once it is accepted, delete this file and tag the release (commit 04d10fe).
9 changes: 4 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
Package: joyn
Type: Package
Title: Tool for diagnosys and useful features of joins of data frames
Version: 0.0.0.9008
Author: Who wrote it
Title: Tool for Diagnosis of Tables Joins and Complementary Join Features
Version: 0.0.1
Authors@R: person("R.Andres", "Castaneda",
email = "[email protected]",
role = c("aut", "cre"))
Description: Tool for diagnosys of joins of data frames. It combines the speed
`data.table`, the versatilit of `dplyr`, and the diagnosys and features of
Description: Tool for diagnosis of joins of data frames. It combines the speed
`data.table`, the flexibility of `dplyr`, and the diagnosis and features of
the `merge` command in `Stata`.
License: MIT + file LICENSE
Encoding: UTF-8
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# 0.0.1
First Public release
4 changes: 2 additions & 2 deletions R/merge.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if (getRversion() >= '2.15.1')
#' @param keep character: One of *"full"*, *"left"*, *"master"*, *"right"*,
#' *"using"*, *"inner"*. Default is *"full"*. Even though this is not the
#' regular behavior of joins in R, the objective of `joyn` is to present a
#' diagnosys of the join, so that it must use by default a full join. Yet, if
#' diagnosis of the join, so that it must use by default a full join. Yet, if
#' *"left"* or *"master"*, it keeps the observations that matched in both
#' tables and the ones that did not match in x. The ones in y will be
#' discarded. If *"right"* or *"using"*, it keeps the observations that
Expand Down Expand Up @@ -135,7 +135,7 @@ merge <- function(x,
roll = NULL,
keep_y_in_x = FALSE,
sort = TRUE,
verbose = TRUE) {
verbose = getOption("joyn.verbose")) {

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Initial parameters ---------
Expand Down
10 changes: 10 additions & 0 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.onLoad <- function(libname, pkgname) {
op <- options()
op.joyn <- list(
joyn.verbose = TRUE
)
toset <- !(names(op.joyn) %in% names(op))
if(any(toset)) options(op.joyn[toset])

invisible()
}
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ knitr::opts_chunk$set(

The goal of `joyn` is to provide the user with a set of tools to analyze the quality
of merging (i.e., joining) data frames, so that it is a **JOY** to join tables with
`joyn`. This is inspired in the command `merge` ofthe statistical software `Stata`.
`joyn`. This is inspired in the command `merge` of the statistical software `Stata`.


## Motivation
Expand Down
100 changes: 51 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
The goal of `joyn` is to provide the user with a set of tools to analyze
the quality of merging (i.e., joining) data frames, so that it is a
**JOY** to join tables with `joyn`. This is inspired in the command
`merge` ofthe statistical software `Stata`.
`merge` of the statistical software `Stata`.

## Motivation

Expand Down Expand Up @@ -124,7 +124,7 @@ y1

# using commong variable `id` as key.
merge(x1, y1)[]
#> i joining by `id`
#> > removing key variables `id` from yvars
#>
#> -- JOYn Report --
#>
Expand All @@ -135,16 +135,16 @@ merge(x1, y1)[]
#> Total 6 100.0%
#> ---------------------------------------------------------- End of JOYn report --
#> id t x y report
#> 1: NA NA 15 NA x
#> 2: 1 1 11 11 x & y
#> 3: 1 2 12 11 x & y
#> 4: 2 1 13 15 x & y
#> 5: 3 2 14 NA x
#> 6: 4 NA NA 16 y
#> 1: 1 1 11 11 x & y
#> 2: 1 2 12 11 x & y
#> 3: 2 1 13 15 x & y
#> 4: 3 2 14 NA x
#> 5: 4 NA NA 16 y
#> 6: NA NA 15 NA x

# keep just those observations that match
merge(x1, y1, keep = "inner")[]
#> i joining by `id`
#> > removing key variables `id` from yvars
#> -- JOYn Report --
#>
#> report n percent
Expand Down Expand Up @@ -176,7 +176,7 @@ y2

# Bad merge for not specifying by argument
merge(x2, y2)[]
#> i joining by `id` and `x`
#> > removing key variables `id` and `x` from yvars
#> -- JOYn Report --
#>
#> report n percent
Expand All @@ -186,20 +186,22 @@ merge(x2, y2)[]
#> Total 9 100.0%
#> ---------------------------------------------------------- End of JOYn report --
#> id x t yd y report
#> 1: NA 15 NA NA NA x
#> 2: 1 16 1 1 11 x & y
#> 1: 1 16 1 1 11 x & y
#> 2: 2 17 NA 2 15 y
#> 3: 2 NA 1 NA NA x
#> 4: 2 17 NA 2 15 y
#> 4: 3 20 NA 3 10 y
#> 5: 3 NA 2 NA NA x
#> 6: 3 20 NA 3 10 y
#> 7: 4 12 2 NA NA x
#> 8: 5 18 NA 5 20 y
#> 9: 6 19 NA 6 13 y
#> 6: 4 12 2 NA NA x
#> 7: 5 18 NA 5 20 y
#> 8: 6 19 NA 6 13 y
#> 9: NA 15 NA NA NA x

# good merge, ignoring variable x from y
merge(x2, y2, by = "id")[]
#> i variable `x` in `y` is ignored in merge because `update_NAs` and
#> > removing key variables `id` from yvars
#> i variable `x` in table y is ignored because arguments `update_NAs` and
#> `update_values` are FALSE.
#>
#> -- JOYn Report --
#>
#> report n percent
Expand All @@ -209,17 +211,17 @@ merge(x2, y2, by = "id")[]
#> Total 7 100.0%
#> ---------------------------------------------------------- End of JOYn report --
#> id t x yd y report
#> 1: NA NA 15 NA NA x
#> 2: 1 1 16 1 11 x & y
#> 3: 2 1 NA 2 15 x & y
#> 4: 3 2 NA 3 10 x & y
#> 5: 4 2 12 NA NA x
#> 6: 5 NA NA 5 20 y
#> 7: 6 NA NA 6 13 y
#> 1: 1 1 16 1 11 x & y
#> 2: 2 1 NA 2 15 x & y
#> 3: 3 2 NA 3 10 x & y
#> 4: 4 2 12 NA NA x
#> 5: 5 NA NA 5 20 y
#> 6: 6 NA NA 6 13 y
#> 7: NA NA 15 NA NA x

# update NAs in x variable form x
merge(x2, y2, by = "id", update_NAs = TRUE)[]
#>
#> > removing key variables `id` from yvars
#> -- JOYn Report --
#>
#> report n percent
Expand All @@ -230,17 +232,17 @@ merge(x2, y2, by = "id", update_NAs = TRUE)[]
#> Total 7 100.0%
#> ---------------------------------------------------------- End of JOYn report --
#> id t x yd y report
#> 1: NA NA 15 NA NA x
#> 2: 1 1 16 1 11 x & y
#> 3: 2 1 17 2 15 NA updated
#> 4: 3 2 20 3 10 NA updated
#> 5: 4 2 12 NA NA x
#> 6: 5 NA 18 5 20 y
#> 7: 6 NA 19 6 13 y
#> 1: 1 1 16 1 11 x & y
#> 2: 2 1 17 2 15 NA updated
#> 3: 3 2 20 3 10 NA updated
#> 4: 4 2 12 NA NA x
#> 5: 5 NA 18 5 20 y
#> 6: 6 NA 19 6 13 y
#> 7: NA NA 15 NA NA x

# Update values in x with variables from y
merge(x2, y2, by = "id", update_values = TRUE)[]
#>
#> > removing key variables `id` from yvars
#> -- JOYn Report --
#>
#> report n percent
Expand All @@ -251,13 +253,13 @@ merge(x2, y2, by = "id", update_values = TRUE)[]
#> Total 7 100.0%
#> ---------------------------------------------------------- End of JOYn report --
#> id t x yd y report
#> 1: NA NA 15 NA NA not updated
#> 2: 1 1 16 1 11 x & y
#> 3: 2 1 17 2 15 NA updated
#> 4: 3 2 20 3 10 NA updated
#> 5: 4 2 12 NA NA not updated
#> 6: 5 NA 18 5 20 y
#> 7: 6 NA 19 6 13 y
#> 1: 1 1 16 1 11 x & y
#> 2: 2 1 17 2 15 NA updated
#> 3: 3 2 20 3 10 NA updated
#> 4: 4 2 12 NA NA not updated
#> 5: 5 NA 18 5 20 y
#> 6: 6 NA 19 6 13 y
#> 7: NA NA 15 NA NA not updated


# do not bring any variable from Y into x, just the report
Expand All @@ -271,12 +273,12 @@ merge(x2, y2, by = "id", yvars = NULL)[]
#> y 2 28.6%
#> Total 7 100.0%
#> ---------------------------------------------------------- End of JOYn report --
#> id t x.x yd y x.y report
#> 1: NA NA 15 NA NA NA x
#> 2: 1 1 16 1 11 16 x & y
#> 3: 2 1 NA 2 15 17 x & y
#> 4: 3 2 NA 3 10 20 x & y
#> 5: 4 2 12 NA NA NA x
#> 6: 5 NA NA 5 20 18 y
#> 7: 6 NA NA 6 13 19 y
#> id t x report
#> 1: 1 1 16 x & y
#> 2: 2 1 NA x & y
#> 3: 3 2 NA x & y
#> 4: 4 2 12 x
#> 5: 5 NA NA y
#> 6: 6 NA NA y
#> 7: NA NA 15 x
```
37 changes: 37 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## Resubmission
This is a resubmission. In this version I have:

* updated the documentation of argument `verbose` in merge.R.

## Test environments
* Local Windows 10, R 4.0.4
* Github Actions checked for windows-latest (release), macOS-latest (release), ubuntu-20.04 (release), ubuntu-20.04 (devel)

## R CMD check results

* When run devtools::check() locally, I got
0 errors | 1 warning | 0 notes

Twarning was:
checking data for ASCII and uncompressed saves ... OK
WARNING
'qpdf' is needed for checks on size reduction of PDFs

* When run check_rhub() locally, I got
0 errors | 0 warning | 1 notes

The note reads:
* Maintainer: 'R.Andres Castaneda <[email protected]>'

New submission
Possibly mis-spelled words in DESCRIPTION:

Stata (11:29)
dplyr (10:39)

Explanation: My Name is "R.Andres". Also, I need to mention both Stata and the
R package dplyr to make it clear what my package does.

* When run in Github Actions, I got,
0 errors | 0 warning | 0 notes

5 changes: 4 additions & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion docs/LICENSE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion docs/articles/advanced-use.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions docs/articles/general-use.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1b1ee87

Please sign in to comment.