Hi, Dear Splusers:
Thanks a lot for Nick Ellis, Carlisle Thacker,Don MacQueen ,
Steve Wofsy, Rolf Turner's help. All of them have realized
the nature of the problem: I must have masked something that
has been used by function cbind.
The function masked() that Nick Ellis recommend is the bast
solution. As a matter of fact, I have created an object
"dimnames", which has the same name as the dimnames attribute
of an matrix. I have tried
> foo <- cbind(1:3,3:5)
> foo
Error in prmatrix(x, rowlab = dn[[1]], collab = cl..: rowlab is wrong
length
> attributes(foo)
$dim:
[1] 3 2
> is.matrix(foo)
[1] T
I should have noticed that there is no dimnames attribute in foo.
the way I found the solution is :
> masked()
[1] ".Random.seed" "dimnames"
> rm(dimnames)
> cbind(1:3,3:5)
[,1] [,2]
[1,] 1 3
[2,] 2 4
[3,] 3 5
I am very appreciated for these helps.
jingshan
On Thu, 22 Mar 2001, jingshan zhang wrote:
> Dear S-users:
>
> I am wondering what the wrong is here.
> When I typed a simple cbind() function,
> it gives the following error:
>
> > cbind(1:3,3:5)
> Error in prmatrix(x, rowlab = dn[[1]], collab = cl..: rowlab is wrong
> length
>
> but when I repeated it in another directory,
> everything is fine. So what I am guessing is that
> maybe I have done something harmful to cbind()
> function. But since I am working in UNIX, I doesn't
> seem to be able to do that. I have tried to quit and
> re-enter, but same thing happened just again.
>
> Did some of you ever encounter such problem?
> Any help is appreciated.
>
> jingshan
>
>
> ---------------------------------------------------------------------
> This message was distributed by s-news@lists.biostat.wustl.edu. To
> unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
> the BODY of the message: unsubscribe s-news
>
|