Re: [R] Re move a number from a vector

2008-03-18 Thread Josh Roofchop
Thanks to both John and Arthur for their replies, they both worked great. Josh Josh Roofchop wrote: > > This should be an easy one, but I haven't been able to figure it out, > > x<-c(2, 4, 6, 9, 10) > #how do I remove a single value > x<-x[-2] # will remove the second element of the vector n

Re: [R] Re move a number from a vector

2008-03-18 Thread Albert Greinoecker
does > x[!x == remove.value] do what you need? [1] 2 6 9 10 regards, Albert Am Dienstag, den 18.03.2008, 05:21 -0700 schrieb Josh Roofchop: > This should be an easy one, but I haven't been able to figure it out, > > x<-c(2, 4, 6, 9, 10) > #how do I remove a single value > x<-x[-2] # will r

Re: [R] Re move a number from a vector

2008-03-18 Thread John Kane
?which x <- x[which(x==remove.value)] --- Josh Roofchop <[EMAIL PROTECTED]> wrote: > > This should be an easy one, but I haven't been able > to figure it out, > > x<-c(2, 4, 6, 9, 10) > #how do I remove a single value > x<-x[-2] # will remove the second element of the > vector not the number