[R] sampling from a list of values while excluding one

From: Juliane Struve <juliane_struve_at_yahoo.co.uk>
Date: Mon, 21 Jul 2008 09:10:39 +0000 (GMT)

Dear list,

I am trying to sample from a list of integers 1:10, but need to exclude one of them. The one to be excluded is a variable called "number" and can take values 1:10. The line below does not work, but shows what I am trying to do. Would somebody be able to help me with the syntax ?

anglenumber=sample(1:10, exclude = "number",size=1,replace=TRUE)

Thank you very much for a hint.



Dr. Juliane Struve
Environmental Scientist
10, Lynwood Crescent
Sunningdale SL5 0BL
01344 620811

Not happy with your email address?.
Get the one you really want - millions of new email addresses available now at Yahoo!

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon 21 Jul 2008 - 09:23:08 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 21 Jul 2008 - 10:32:03 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive