-
Notifications
You must be signed in to change notification settings - Fork 12
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
Comments
Thanks for reporting the issue. If you can provide a minimal reproducible example I can look to see what the problem is. |
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. |
I just came across these warnings as well. The issue seems to be related to 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 |
Thanks for the MWE, the switch from non-warning to warning should make it easy to figure out. |
This is fixed in the development branch. Sorry, I should have fixed this earlier, but lost track of it. |
# 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).
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)
The text was updated successfully, but these errors were encountered: