Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix incompatibility with plyr 1.8

  • Loading branch information...
commit 9866807f776827abd3e8b6c2a4255f76ec2c2fc4 1 parent 52fa7b9
@hadley authored
Showing with 4 additions and 0 deletions.
  1. +2 −0  NEWS
  2. +2 −0  R/cast.r
View
2  NEWS
@@ -1,3 +1,5 @@
+* Fix incompatibility with plyr 1.8
+
* Fix evaluation bug revealed by knitr. (Fixes #18)
* Fixed a bug in `melt` where it didn't automatically get variable names
View
2  R/cast.r
@@ -117,6 +117,8 @@ cast <- function(data, formula, fun.aggregate = NULL, ..., subset = NULL, fill =
overall <- id(rev(ids), drop = FALSE)
ns <- vapply(ids, attr, 0, "n")
+ # Replace zeros (empty inputs) with 1 for dimensions of output
+ ns[ns == 0] <- 1
n <- attr(overall, "n")
# Aggregate duplicates
Please sign in to comment.
Something went wrong with that request. Please try again.