Skip to content
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

Warnings: vector length multiple #117

Closed
overvolting opened this issue Apr 20, 2018 · 5 comments
Closed

Warnings: vector length multiple #117

overvolting opened this issue Apr 20, 2018 · 5 comments

Comments

@overvolting
Copy link

Always receive these warnings.

Warning messages:
1: In cbind(integer(2L), seq.diffs) :
number of rows of result is not a multiple of vector length (arg 1)
2: In cbind(integer(2L), seq.diffs) :
number of rows of result is not a multiple of vector length (arg 1)

@brodieG
Copy link
Owner

brodieG commented Apr 21, 2018

Thanks for reporting the issue. If you can provide a minimal reproducible example I can look to see what the problem is.

@brodieG
Copy link
Owner

brodieG commented Apr 26, 2018

Since I haven't heard from you on this I'm closing the issue. Feel free to re-open if you can produce a minimally reproducible example.

@brodieG brodieG closed this as completed Apr 26, 2018
@bastistician
Copy link

I just came across these warnings as well. The issue seems to be related to large data frames.
Of course, help(diffPrint) already says ...

One thing to keep in mind is that 'diffPrint' is not designed to work with very large data frames.

Anyway, here is a MWE, using diffobj 0.3.4 in vanilla R 4.0.5:

library("diffobj")
a <- b <- data.frame(ID = 0, value = 1)
b$value <- 2

## the following works:
diffPrint(a, b, mode = "unified")
#> < a              
#> > b              
#> @@ 1,2 / 1,2 @@  
#>     ID value     
#> < 1  0     1     
#> > 1  0     2

## now artificially increase the number of columns
## 1. no warning:
diffPrint(a[c(rep(1, 85), 2)], b[c(rep(1, 85), 2)], mode = "unified")
#> < a[c(rep(1, 85), 2)]                                                      
#> > b[c(rep(1, 85), 2)]                                                      
#> @@ 12,3 / 12,3 @@                                                          
#> ~   ID.26 ID.27 ID.28 ID.29 ID.30 ID.31 ID.32 ID.33 ID.34 ID.35 ID.36 ID.37
#>   1     0     0     0     0     0     0     0     0     0     0     0     0
#>     ID.74 ID.75 ID.76 ID.77 ID.78 ID.79 ID.80 ID.81 ID.82 ID.83 ID.84 value
#> < 1     0     0     0     0     0     0     0     0     0     0     0     1
#> > 1     0     0     0     0     0     0     0     0     0     0     0     2

## 2. warning:
diffPrint(a[c(rep(1, 86), 2)], b[c(rep(1, 86), 2)], mode = "unified")
#> Warning in cbind(integer(2L), seq.diffs): number of rows of result is not a
#> multiple of vector length (arg 1)

#> Warning in cbind(integer(2L), seq.diffs): number of rows of result is not a
#> multiple of vector length (arg 1)
#> < a[c(rep(1, 86), 2)]                                                      
#> > b[c(rep(1, 86), 2)]                                                      
#> @@ 14,3 / 14,3 @@                                                          
#> ~   ID.26 ID.27 ID.28 ID.29 ID.30 ID.31 ID.32 ID.33 ID.34 ID.35 ID.36 ID.37
#>   1     0     0     0     0     0     0     0     0     0     0     0     0
#>     value                                                                  
#> < 1     1                                                                  
#> > 1     2

@brodieG
Copy link
Owner

brodieG commented Apr 14, 2021

Thanks for the MWE, the switch from non-warning to warning should make it easy to figure out.

@brodieG brodieG reopened this Apr 14, 2021
@brodieG brodieG added the bug label Apr 14, 2021
@brodieG
Copy link
Owner

brodieG commented Oct 4, 2021

This is fixed in the development branch. Sorry, I should have fixed this earlier, but lost track of it.

@brodieG brodieG closed this as completed in e9fc0a2 Oct 5, 2021
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Nov 29, 2021
# diffobj
## v0.3.5

* Options automatically fallback to factory defaults if they are unset (h/t
  @gadenbui).
* [#158](brodieG/diffobj#158): Calling `diff*` with
  `do.call` now works without warnings.
* [#117](brodieG/diffobj#117): Fix guide detection
  with very wide wrapped data.frames (h/t @bastician, @overvolting).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants