[Rd] dim "heritage"

Prof Brian Ripley ripley@stats.ox.ac.uk
Sun, 1 Apr 2001 18:40:16 +0100 (BST)


On Sun, 1 Apr 2001, Erich Neuwirth wrote:

> when i do
>
> x<-4:1
> dim(x)<-c(4,1)
>
> and then
> z<-sin(x)
> dim(z) is c(4,1)
>
> sort(x)
> however, does not have a dim attribute.
>
> is this intended behavior?

Yes.  You would expect x^2 to act elementwise, and all elementwise
arithmetic operations keep the dimensions.

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._