[Rd] Documentation of ``Extract'' re. drop argument (PR#4297)

david.meyer at ci.tuwien.ac.at david.meyer at ci.tuwien.ac.at
Thu Sep 25 14:10:37 MEST 2003


Problem:

?Extract

does not clearly state that the `drop' argument can only be used in 
subscripting, but not in subassigning.

Example:

x <- t(1:10)
x
        [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
  [1,]     1    2    3    4    5    6    7    8    9    10

x[,1:5,drop=F] <- 10:14
Error: incorrect number of subscripts

but

x[,1:5] <- 10:14
x
       [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
  [1,]   10   11   12   13   14    6    7    8    9    10

Proposed fix:

Adding a corresponding note in the doc. of the `drop' argument, or 
after the

  If one of these expressions appears on the left side of an
  assignment then that part of 'x' is set to the value of the right
  hand side of the assignment.

paragraph in the `details' section of the `Extract' help page.


> version
          _                platform i686-pc-linux-gnu
arch     i686             os       linux-gnu        system   i686, 
linux-gnu  status   alpha            major    1                minor    
8.0              year     2003             month    09               
day      24               language R                


-- 
         Mag. David Meyer            Wiedner Hauptstrasse 8-10
Vienna University of Technology     A-1040 Vienna/AUSTRIA
          Department of              Tel.: (+431) 58801/10772
Statistics and Probability Theory   Fax.: (+431) 58801/10798



More information about the R-devel mailing list