8000 Tibble fix by kieranjmartin · Pull Request #50 · gowerc/diffdf · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Tibble fix #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8000
Merged
merged 10 commits into from
Mar 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 2020-03-16.
Once it is accepted, delete this file and tag the release (commit c1d40fd0d8).
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Package: diffdf
Type: Package
Title: Dataframe Difference Tool
Version: 1.0.3
Version: 1.0.4
Authors@R: c(
person("Craig" ,"Gower" , email = "craig.gower@roche.com" , role = c("cre","aut")),
person("Craig" ,"Gower-Page" , email = "craig.gower-page@roche.com" , role = c("cre","aut")),
person("Kieran", "Martin" , email = "kieran.martin@roche.com" , role = "aut")
)
Description: Functions for comparing two data.frames against
Expand All @@ -27,7 +27,7 @@ Suggests:
stringr,
devtools,
covr
RoxygenNote: 6.1.1
RoxygenNote: 7.0.2
VignetteBuilder: knitr
License: MIT + file LICENSE
URL: https://github.com/gowerc/diffdf
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ S3method(print,diffdf)
export(diffdf)
export(diffdf_has_issues)
export(diffdf_issuerows)
importFrom(tibble,as.tibble)
importFrom(tibble,as_tibble)
importFrom(tibble,rownames_to_column)
importFrom(tibble,tibble)
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# diffdf 1.0.4

- No new functionality
- Update to make package compatible with tibble 3.0.0

# diffdf 1.0.3

- No new functionality
Expand Down
4 changes: 3 additions & 1 deletion R/ascii_tables.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ invert <- function(x){
#' @param line_prefix Symbols to prefix infront of every line of the table
as_ascii_table <- function(dat, line_prefix = " "){


## Convert every value to character and crop to a suitable length
dat[] <- apply(dat, c(1, 2), as_cropped_char)
dat <- as_tibble(apply(dat, c(1, 2), as_cropped_char))

hold <- list()
COLS <- colnames(dat)

Expand Down
4 changes: 2 additions & 2 deletions R/is_different.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' This subsets the data set on the variable name, picks out differences and returns a tibble
#' of differences for the given variable
#' @importFrom tibble as.tibble
#' @importFrom tibble as_tibble
#' @param variablename name of variable being compared
#' @param keynames name of keys
#' @param datain Inputted dataset with base and compare vectors
Expand All @@ -25,7 +25,7 @@ is_variable_different <- function (variablename, keynames, datain, ...) {

names(datain)[names(datain) %in% c(xvar, yvar)] <- c("BASE", "COMPARE")

x <- as.tibble(
x <- as_tibble(
subset(
datain,
outvect,
Expand Down
9 changes: 5 additions & 4 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
## Release summary
In this version I have:
- Updated the package to use suppressWarnings(RNGversion("3.5.0")) wherever set.seed() has been used to make sure test results and vignette results are consistent after the planned changes to the random number generator
- Updated the package to fix errors introduced by the most recent version of tibble (2.99.99.9014 which will become 3.0.0 upon release)
- Updated my email in the maintainers list from craig.gower@roche.com to craig.gower-page@roche.com as I have changed my name after getting married and work updated my email address. I no longer have access or the ability to send emails from the old email address however emails to the old email address are forwarded to the new one (that is if you wish to confirm this change).

## Test environments
- local Mac OS Mojave R 3.5.2
- Win-Builder R-release
- Debian Linux R-release (via rhub)
- local Mac OS Mojave R 3.6.2
- Windows Server 2008 R2 SP1, R-devel, 32/64 bit (Rhub)
- Debian Linux, R-release, GCC (Rhub)

## R CMD check results
R CMD check results
Expand Down
9 changes: 7 additions & 2 deletions man/cast_variables.Rd

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

8 changes: 6 additions & 2 deletions man/compare_vectors.numeric.Rd

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

14 changes: 11 additions & 3 deletions man/diffdf.Rd

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

7 changes: 5 additions & 2 deletions man/generate_keyname.Rd

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

10 changes: 8 additions & 2 deletions man/identify_differences.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/test-core.R
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ numdiffcheck <-function(compdat, target, value){
)

expect_equal(
diffdf_ob$`No of Differences`[1] , value,
diffdf_ob$`No of Differences`[[1]] , value,
info = 'Number of differences incorrect'
)
}
Expand Down
17 changes: 1 addition & 16 deletions vignettes/diffdf-basic.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ diffdf(test_data , test_data2 , suppress_warnings = T)

```{r}
test_data2 <- test_data
test_data2[5,2] <- "blah"
test_data2[,2] <- as.character(test_data2[,2])
diffdf(test_data , test_data2 , suppress_warnings = T)
```

Expand Down Expand Up @@ -118,21 +118,6 @@ test_data2$INTEGER[c(5,2,15)] <- 99L
diffdf( test_data , test_data2 , keys = c("GROUP1" , "GROUP2") , suppress_warnings = T)
```

## Printing and Saving the Compare Log

When there are lots of mismatches the log can become unwieldly. In order to deal with this you can either use the `print` function to display a particular variable or the `outfile` option to save the log to a file.


```{r, eval=FALSE}
result <- diffdf(
test_data ,
test_data2 ,
keys = c("GROUP1" , "GROUP2") ,
outfile = "reports/diffdf.log"
)

```

## Misc

### Accessing problem rows
Expand Down
0