Skip to content
Prev 17218 / 398502 Next

i think i asked the wrong ?

Dear Jimi,
At 08:26 AM 2/18/2002 -0500, you wrote:
You can use negative indices to remove entries from a vector; for example,

 > v <- 1:10
 > v[-5]
[1]  1  2  3  4  6  7  8  9 10
 > v[-c(3,6)]
[1]  1  2  4  5  7  8  9 10

Removing single elements from a matrix doesn't make sense -- what goes in 
the hole? You can, however, remove entire rows or columns with negative 
indices.

(Indexing is discussed in all of the basic introductions to R and S of 
which I'm aware. It probably makes sense to read one of these -- you'll 
save time in the long run.)

I hope that this helps,
  John

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Message-ID: <5.1.0.14.2.20020218130721.01d88330@mcmail.cis.mcmaster.ca>
In-Reply-To: <4.3.2.7.2.20020218082326.00a9c380@pop.service.ohio-state.e du>