Skip to content
Prev 171612 / 398503 Next

learning R

Fuchs Ira wrote:
because a[2] becomes a newly allocated vector once you make the
assignment, and so the assignment does not affect a.  however:

    names(a)[2] = 'too'
   
will affect a the way you seem to wish.
you can do this:

    z = matrix(c(x, y), nrow=2, ncol=3, byrow=TRUE)

but rbind seems much simpler.

vQ