[R] random samples

2005-01-13 Thread nicolas . deig
hi, I am encoutering a very little problem that seemed to be so easy to solve I need to divide the array A-c(1:200) into two subsets at random. Therefore I use the function sample in R: S-sample(A,100) for a random sample of size 100. Then I need the values in A that are not selected

Re: [R] random samples

2005-01-13 Thread TEMPL Matthias
which(A%in%S==FALSE) Best Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von [EMAIL PROTECTED] Gesendet: Donnerstag, 13. Jänner 2005 13:51 An: r-help@stat.math.ethz.ch Betreff: [R] random samples hi, I am encoutering a very

RE: [R] random samples

2005-01-13 Thread Liaw, Andy
See ?setdiff. Andy From: [EMAIL PROTECTED] hi, I am encoutering a very little problem that seemed to be so easy to solve I need to divide the array A-c(1:200) into two subsets at random. Therefore I use the function sample in R: S-sample(A,100) for a random sample

RE: [R] random samples

2005-01-13 Thread John Fox
Dear Nicolas, -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Thursday, January 13, 2005 7:51 AM To: r-help@stat.math.ethz.ch Subject: [R] random samples hi, I am encoutering a very little problem that seemed to be so

Re: [R] random samples

2005-01-13 Thread Philipp Pagel
On Thu, Jan 13, 2005 at 01:50:38PM +0100, [EMAIL PROTECTED] wrote: I need to divide the array A-c(1:200) into two subsets at random. Therefore I use the function sample in R: I suggest a slightly different approach which is probably faster than using setdif() or %in% and friends: a -