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

Juliane Struve juliane_struve at yahoo.co.uk
Mon Jul 21 11:10:39 CEST 2008

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! http://uk.docs.yahoo.com/ymail/new.html

More information about the R-help mailing list