[R] Extracting subset of a vector

2008-10-11 Thread Megh Dal
I have 2 vecros : x-c(100,96,88,100,100,96,80,68,92,96,88,92,68,84,84,88,72,88,72,88) x1 = sample(x, 5, replace=FALSE) Now i want to get remaining values of vector x those are not member of vector x1. Can anyone please tell me how to do that? __

Re: [R] Extracting subset of a vector

2008-10-11 Thread Daniel Malter
: Saturday, October 11, 2008 3:26 PM An: [EMAIL PROTECTED] Betreff: [R] Extracting subset of a vector I have 2 vecros : x-c(100,96,88,100,100,96,80,68,92,96,88,92,68,84,84,88,72,88,72,88) x1 = sample(x, 5, replace=FALSE) Now i want to get remaining values of vector x those are not member of vector x1. Can

Re: [R] Extracting subset of a vector

2008-10-11 Thread Jorge Ivan Velez
Hi Megh, Try this: x-c(100,96,88,100,100,96,80,68,92,96,88,92,68,84,84,88,72,88,72,88) x1 = sample(x, 5, replace=FALSE) x[ ! x %in% x1] HTH, Jorge On Sat, Oct 11, 2008 at 3:25 PM, Megh Dal [EMAIL PROTECTED] wrote: I have 2 vecros :

Re: [R] Extracting subset of a vector

2008-10-11 Thread Peter Dalgaard
Megh Dal wrote: I have 2 vecros : x-c(100,96,88,100,100,96,80,68,92,96,88,92,68,84,84,88,72,88,72,88) x1 = sample(x, 5, replace=FALSE) Now i want to get remaining values of vector x those are not member of vector x1. Can anyone please tell me how to do that? x[!(x %in% x1)] should do it.

Re: [R] Extracting subset of a vector

2008-10-11 Thread Megh Dal
Thanks for this suggestion. However I am not getting : length(x) = length(x1) + length(x[ ! x %in% x1]) Any better idea? --- On Sun, 10/12/08, Jorge Ivan Velez [EMAIL PROTECTED] wrote: From: Jorge Ivan Velez [EMAIL PROTECTED] Subject: Re: [R] Extracting subset of a vector To: [EMAIL

Re: [R] Extracting subset of a vector

2008-10-11 Thread Peter Dalgaard
] Extracting subset of a vector To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Date: Sunday, October 12, 2008, 1:06 AM Hi Megh, Try this: x-c(100,96,88,100,100,96,80,68,92,96,88,92,68,84,84,88,72,88,72,88) x1 = sample(x, 5, replace=FALSE) x[ ! x %in% x1] HTH, Jorge On Sat, Oct 11, 2008 at 3:25 PM

Re: [R] Extracting subset of a vector

2008-10-11 Thread Jorge Ivan Velez
Ivan Velez [EMAIL PROTECTED] wrote: From: Jorge Ivan Velez [EMAIL PROTECTED] Subject: Re: [R] Extracting subset of a vector To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Date: Sunday, October 12, 2008, 1:06 AM Hi Megh, Try this: x-c

Re: [R] Extracting subset of a vector

2008-10-11 Thread jim holtman
, 10/12/08, Jorge Ivan Velez [EMAIL PROTECTED] wrote: From: Jorge Ivan Velez [EMAIL PROTECTED] Subject: Re: [R] Extracting subset of a vector To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Date: Sunday, October 12, 2008, 1:06 AM Hi Megh, Try this: x-c