[R] matrix problem

William Simpson william.a.simpson at gmail.com
Sat Jul 4 17:59:19 CEST 2009


Thanks everyone for the help.

I should have said that I want to do this generally, not as a one-off.
So I want a function to do it. Like this

tp<-function(x, nr, nc)
{
matrix( c(x,rep(0, nr-length(x)+1)),  nrow=nr, ncol=nc)
}

tp(x=c(1,2), nr=5, nc=4)

This one looks good -- the warning message is annoying though...


Bill




More information about the R-help mailing list