Skip to content

Commit

Permalink
Release 0.1.3 (#89)
Browse files Browse the repository at this point in the history
Allows single-column data frames to be compared, rather than erroring
No longer produces deprecated code warnings when running tests
Removed unnecessary console output during tests
Changed an if condition to meet guidelines around not using && operator with logical vectors
Fixed issue with Travis CI tests not passing
Added pkgdown documentation
  • Loading branch information
sajohnston authored May 4, 2020
1 parent 2824fec commit 2457f48
Show file tree
Hide file tree
Showing 34 changed files with 514 additions and 312 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
on:
push:
branches: master

name: pkgdown
defaults:
run:
working-directory: dataCompareR

jobs:
pkgdown:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@master

- uses: r-lib/actions/setup-pandoc@master

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), "./depends.Rds", version = 2)
shell: Rscript {0}

- name: Cache R packages
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: macOS-r-3.6-${{ hashFiles('./depends.Rds') }}
restore-keys: macOS-r-3.6-

- name: Install dependencies
run: |
install.packages("remotes")
remotes::install_deps(dependencies = TRUE)
remotes::install_dev("pkgdown")
shell: Rscript {0}

- name: Install package
run: R CMD INSTALL .

- name: Copy README
run: cp ../README.md index.md

- name: Deploy package
run: pkgdown::deploy_to_branch(new_process = FALSE)
shell: Rscript {0}
11 changes: 8 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
language: r
r:
- 4.0.0
- devel
cache: packages
before_install:
- cd dataCompareR
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
os:
- linux
dist: xenial
services:
- xvfb
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

|CRAN downloads|`dev` build|`master` build|
|------|-----|-----|
|[![](http://cranlogs.r-pkg.org/badges/dataCompareR)](http://cran.rstudio.com/web/packages/dataCompareR/index.html) |[![Build Status](https://travis-ci.org/capitalone/dataCompareR.svg?branch=dev)](https://travis-ci.org/capitalone/dataCompareR) | [![Build Status](https://travis-ci.org/capitalone/dataCompareR.svg?branch=master)](https://travis-ci.org/capitalone/dataCompareR)|
|[![](https://cranlogs.r-pkg.org/badges/dataCompareR)](http://cran.rstudio.com/web/packages/dataCompareR/index.html) |[![Build Status](https://travis-ci.org/capitalone/dataCompareR.svg?branch=dev)](https://travis-ci.org/capitalone/dataCompareR) | [![Build Status](https://travis-ci.org/capitalone/dataCompareR.svg?branch=master)](https://travis-ci.org/capitalone/dataCompareR)|


dataCompareR is an R package that allows users to compare two datasets and view a report on the similarities and differences.
Expand All @@ -19,7 +19,7 @@ It’s expected that dataCompareR will be used to compare data frames, but it ca

### Requirements

Confirmed as working on R v3.2.3 and later on Linux/Windows, both via RStudio and through the command line.
Confirmed as working on R v3.6.3 and v4.0.0 for Windows, as well as v3.6.2, v4.0.0 and the `devel` release for Linux.
Package was built with the following dependencies, but we anticipate it will work with later versions of these packages.

| Package|Version|Source code URL|
Expand All @@ -33,14 +33,14 @@ Package was built with the following dependencies, but we anticipate it will wor

You can install from the CRAN via:

```{r}
```r
install.packages("dataCompareR")
```

You can also install the latest version directly from GitHub via


```{r}
```r
library(devtools)
install_git('https://github.com/capitalone/dataCompareR.git', branch = 'master',
subdir = 'dataCompareR', type = 'source', repos = NULL,
Expand Down Expand Up @@ -108,6 +108,8 @@ https://cran.r-project.org/package=dataCompareR

- Version 0.1.0 released on 2017-07-17
- Version 0.1.1 released on 2017-11-14
- Version 0.1.2 released on 2019-09-07
- Version 0.1.3 released on 2020-05-01

## External Contributors

Expand Down
13 changes: 9 additions & 4 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
## Test environments
* local Windows 10 install, R 3.4.0
* RHEL 6 server, R 3.2.3
* win-builder (devel, release, oldrelease)
* local Windows 10 install, R 4.0.0
* Ubuntu 16.04.6 (on travis-ci), R 3.6.2, R 4.0.0, devel R 4.1.0
* win-builder (release, oldrelease)

## R CMD check results
Status: OK

R CMD check results
0 errors | 0 warnings | 0 notes
0 errors | 0 warnings | 1 notes


The note was about the submission status and mentioned the archival of the package due to the problems not being corrected despite reminders.
The dataCompareR package is maintained by employees of Capital One.
When the previous lead maintainer left the company, the reminders were unexpectedly not visible to the current maintainers.
This has been fixed.

## Downstream dependencies
No downstream dependencies
3 changes: 3 additions & 0 deletions dataCompareR/.Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
^.*\.Rproj$
^\.Rproj\.user$
^_pkgdown\.yml$
^docs$
^pkgdown$
18 changes: 11 additions & 7 deletions dataCompareR/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Package: dataCompareR
Title: Compare Two Data Frames and Summarise the Difference
Version: 0.1.2
Authors@R: c(person("Rob", "Noble-Eddy", email = "[email protected]", role = c("aut", "cre")),
person("Sarah", "Johnston", role = c("aut")),
person("Sarah", "Pollicott", role = c("aut")),
Version: 0.1.3
Authors@R: c(
person("Sarah", "Johnston", email = "[email protected]", role = c("aut", "cre")),
person("Rob", "Noble-Eddy", role = c("aut")),
person("Merlijn", "van Horssen", role = c("aut")),
person("Krishan", "Bhasin", role = c("aut")),
person("Sarah", "Pollicott", role = c("aut")),
person("Lukas", "Drapal", role = c("ctb")),
person("Nikolaos", "Perrakis", role = c("ctb")),
person("Nikhil", "Thomas Joy", role = c("ctb")),
Expand All @@ -18,10 +20,12 @@ Authors@R: c(person("Rob", "Noble-Eddy", email = "[email protected]", ro
person("David", "Robinson", role = c("ctb")),
person("Cheryl", "Renton", role = c("ctb")),
person("Matt", "Triggs", role = c("ctb")),
person("Krishan", "Bhasin", role = c("ctb")),
person("Carola", "Deppe", role = c("ctb")),
person("Ruijing", "Li", role = c("ctb")),
person("John", "Swift", role = c("ctb"))
person("John", "Swift", role = c("ctb")),
person(given = "Capital One Services, LLC",
email = "[email protected]",
role = c("cph"))
)
Description: Easy comparison of two tabular data
objects in R. Specifically designed to show differences between two sets of
Expand All @@ -40,7 +44,7 @@ URL: https://github.com/capitalone/dataCompareR
BugReports: https://github.com/capitalone/dataCompareR/issues
License: Apache License 2.0 | file LICENSE
LazyData: true
RoxygenNote: 6.1.0
RoxygenNote: 7.1.0
Suggests:
testthat,
data.table,
Expand Down
2 changes: 1 addition & 1 deletion dataCompareR/R/out_generateMismatchData.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#' Note that this function requires the user to pass in the two data frames used in the inital comparison. If this data
#' does not match that used for the generation of the dataCompareR object the results produced will not be accurate.
#' @family dataCompareR.functions
#' @param x A dataCompareRobject.
#' @param x A \code{dataCompareRobject}.
#' @param dfA Data frame (or object coercable to a data frame). One of the two data frames used in the initial rCompare call.
#' @param dfB Data frame (or object coercable to a data frame). One of the two data frames used in the initial rCompare call.
#' @param ... Unused currently, may be used in future
Expand Down
23 changes: 11 additions & 12 deletions dataCompareR/R/pd_matchRows.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@
#' @return A list containing the two dataframes, subsetted by shared indices, and a list which itself
#' contains dataframes for the dropped rows
matchRows <- function(df_a, df_b, indices = NA)
{

if (length(indices ==1) && is.na(indices)) {
return(matchNoIndex(df_a, df_b))
}

if(length(indices) == 1){
return(matchSingleIndex(df_a, df_b, indices))
{
if (length(indices) == 1) {
if (is.na(indices)) {
return(matchNoIndex(df_a, df_b))
} else {
return(matchSingleIndex(df_a, df_b, indices))
}
}

if(length(indices) > 1){
Expand Down Expand Up @@ -164,9 +163,9 @@ matchNoIndex <- function(df_a, df_b)
if(nrow(df_a)>nrow(df_b)) {

if(nrow(df_b)==0) {
df_a_subset <- df_a[0,]
df_a_subset <- df_a[0, , drop=FALSE]
} else {
df_a_subset <- df_a[1:nrow(df_b),]
df_a_subset <- df_a[1:nrow(df_b), , drop=FALSE]
}

df_b_subset <- df_b
Expand All @@ -177,9 +176,9 @@ matchNoIndex <- function(df_a, df_b)
df_a_subset <- df_a

if(nrow(df_a)==0) {
df_b_subset <-df_b[0,]
df_b_subset <-df_b[0, , drop=FALSE]
} else {
df_b_subset <-df_b[1:nrow(df_a),]
df_b_subset <-df_b[1:nrow(df_a), , drop=FALSE]
}

rows_dropped_from_a <- data.frame(indices_removed=integer())
Expand Down
10 changes: 10 additions & 0 deletions dataCompareR/_pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
destination: docs

reference:
- contents:
- matches("rCompare")
- matches("generateMismatchData")
- matches("saveReport")
- print.dataCompareRobject
- summary.dataCompareRobject
- print.summary.dataCompareRobject
10 changes: 6 additions & 4 deletions dataCompareR/man/generateMismatchData.Rd

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

11 changes: 6 additions & 5 deletions dataCompareR/man/print.dataCompareRobject.Rd

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

19 changes: 13 additions & 6 deletions dataCompareR/man/rCompare.Rd

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

22 changes: 15 additions & 7 deletions dataCompareR/man/saveReport.Rd

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

8 changes: 5 additions & 3 deletions dataCompareR/man/summary.dataCompareRobject.Rd

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

8 changes: 6 additions & 2 deletions dataCompareR/man/validateArguments.Rd

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

1 change: 1 addition & 0 deletions dataCompareR/tests/testthat/createTitanicDatasets.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#* Row 8: name in uppercase
#* Row 9: special characters included

if (!require(titanic)) install.packages("titanic")

#titanicKK <- read.csv('./tests/testthat/titanic_train.csv')
titanic <- titanic_train
Expand Down
Loading

0 comments on commit 2457f48

Please sign in to comment.