Skip to content

Error: arguments imply differing number of rows

2 messages · Jeffrey T. Steedle, John Kane

#
I am simply trying to put 4 boxplots on the same plot, but I keep  
getting the "arguments imply differing number of rows" error. Here, I  
have two variables: a factor x of length 1762 (with 4 levels) and a  
numeric variable y of length 1762. How is it that my arguments imply  
differing numbers of rows?
[1] 1762
[1] 1762
[1] TRUE
[1] TRUE
Error in data.frame(group, x) :
   arguments imply differing number of rows: 1762, 2165
Error in data.frame(group, x) :
   arguments imply differing number of rows: 1762, 2165
#
Try str() on both objects and see what you get.  It
does not look like you have two vectors of
length=1762.

See this for example
=====================================================
aa <- c("A", "B", "D", "D","B", "B","D", "A", "C",
"C", "A","D")
bb <- rnorm(length(aa))
cc <- matrix(rnorm(length(aa)),nrow=2)

length(bb)
length(cc)

boxplot(bb~aa)
boxplot(cc~aa)
======================================================

--- "Jeffrey T. Steedle" <jsteedle at stanford.edu>
wrote:
[[elided trailing spam]]