On 30 Jun 2010, at 22:55, Allan Engelhardt wrote:
>> > a$z=z
> You are (kind of) assigning *two* columns from the data frame "z" to
> the name 'z' in "a" which is probably not going to work as you
> expect. R tries to be clever which may or may not be a Good Thing.
> Try
>
> a$z1 <- z[,1]
On 30/06/10 20:46, Michael Lachmann wrote:
It took me some time to find this bug in my code. Is this a feature of
R? Am I doing something wrong?
> a=data.frame(x=1:10,y=1:10)
> b=data.frame(x=11:20,y=11:20)
> z=data.frame(1:10,11:20)
> a$z=z
You are (kind of) assigning *two* columns from the d
It took me some time to find this bug in my code. Is this a feature of
R? Am I doing something wrong?
> a=data.frame(x=1:10,y=1:10)
> b=data.frame(x=11:20,y=11:20)
> z=data.frame(1:10,11:20)
> a$z=z
> b$z=z
> rbind(a,b)
Error in `row.names<-.data.frame`(`*tmp*`, value = c("1", "2", "3",
"4
3 matches
Mail list logo