david.meyer@ci.tuwien.ac.at
2003-Sep-25 13:09 UTC
[Rd] Documentation of ``Extract'' re. drop argument (PR#4297)
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
Peter Dalgaard BSA
2003-Sep-25 15:48 UTC
[Rd] Documentation of ``Extract'' re. drop argument (PR#4297)
david.meyer@ci.tuwien.ac.at writes:> 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. >I'm fixing this and documenting logical and matrix indexing while I'm there. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907