I am porting part of a program (not enough to compile and run) from R to C++. I am not familiar with R. I have done okay using the references online, but was stumped by th
Negative indices specify dropping (rather than retaining) particular elements ... so x[,-1]
specifies dropping the first column (rows are the first dimension, before the comma, and columns are the second dimension, after the comma). From ?"["
( http://stat.ethz.ch/R-manual/R-devel/library/base/html/Extract.html ):
For ‘[’-indexing only: ‘i’, ‘j’, ‘...’ can be logical vectors, indicating elements/slices to select. Such vectors are recycled if necessary to match the corresponding extent. ‘i’, ‘j’, ‘...’ can also be negative integers, indicating elements/slices to leave out of the selection.