[Rd] x[c()] <- value sets the mode to mode(value)

From: Henrik Bengtsson <hb_at_stat.berkeley.edu>
Date: Tue, 08 Dec 2009 17:44:48 -0800


Only for the record,

an unnecessary overhead when nothing is assigned:

> x <- integer(10)
> str(x)

 int [1:10] 0 0 0 0 0 0 0 0 0 0
> x[c()] <- 1.0;
> str(x)
 num [1:10] 0 0 0 0 0 0 0 0 0 0

'x' could equally well have renamed untouched.

/Henrik



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed 09 Dec 2009 - 01:48:17 GMT

This archive was generated by hypermail 2.2.0 : Wed 09 Dec 2009 - 08:11:02 GMT