Re: [Rd] matrices with names

2017-07-27 Thread Suzen, Mehmet
Not always, see what happens with lapply: > x<-matrix(12,1,1) > names(x)<-"one" > y<-matrix(1,1,1) > names(y)<-"one" > dput(lapply(x,`+`,e2=y)) structure(list(one = structure(13, .Dim = c(1L, 1L))), .Names = "one") >dput(lapply(x,`+`,e2=1)) structure(list(one = 13), .Names = "one") Prof. Ripley

[Rd] matrices with names

2017-07-20 Thread William Dunlap via R-devel
How should R deal with matrices that have a 'names' attribute? S (and S+) did not allow an object to have both dims and names but R does. However, some R functions copy the dims but not the names to the returned value and some copy both. I don't see a pattern to it. Is there a general rule for