[R] More trouble with empty subsets

David Brahm a215020 at agate.fmr.com
Fri Oct 12 16:20:33 CEST 2001


Here's another curious problem with empty subsets:
R> x <- as.factor(1:10)
R> x[] <- NA
  Error in "[<-.factor"(*tmp*, , value = NA) : 
      Argument "i" is missing, with no default

Bug, or merely different from S-Plus?

			       -- David Brahm (brahm at alum.mit.edu)

Peter Dalgaard <p.dalgaard at biostat.ku.dk> in thread [Trouble with 3-dots] said:
> Time might be better spent figuring out why 
> > "[<-"(x,value=0)
> Error: SubAssignArgs: invalid number of arguments
> whereas x[]<-0 works fine. (So does "[<-"(x,,value=0), which could be
> part of the explanation).
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list