It's quite intentional, as it is the documented behaviour of data.frame:
Objects passed to 'data.frame' should have the same number of
rows, but atomic vectors, factors and character vectors protected
by 'I' will be recycled a whole number of times if necessary.
data.frame(a =
Prof Brian Ripley wrote:
It's quite intentional, as it is the documented behaviour of data.frame:
Objects passed to 'data.frame' should have the same number of
rows, but atomic vectors, factors and character vectors protected
by 'I' will be recycled a whole number of times if
On Fri, 10 Nov 2006, Frank E Harrell Jr wrote:
Prof Brian Ripley wrote:
It's quite intentional, as it is the documented behaviour of data.frame:
Objects passed to 'data.frame' should have the same number of
rows, but atomic vectors, factors and character vectors protected
by
I have a problem when one of the vectors in a list needs to be
replicated to have the appropriate length, and an attribute is present.
w - list(a=1, b=2:3)
as.data.frame(w)
a b
1 1 2
2 1 3
attr(w$a,'label') - 'foo'
as.data.frame(w)
Error in data.frame(a = 1, b = c(2, 3), check.names