igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Sample fuction.


From: Tamás Nepusz
Subject: Re: [igraph] Sample fuction.
Date: Mon, 9 Apr 2012 14:24:03 +0200

This question is not related to igraph; it belongs to the R mailing lists. 
However, a simple solution is by using setdiff() to remove the chosen elements 
from your vector:  

numbers <- 1:10
s <- sample(numbers, 3)
numbers <- setdiff(numbers, s)
s <- sample(numbers, 3)


...

--  
T.


On Monday, 9 April 2012 at 14:18, Χαραλαμπόπουλος Ιωάννης wrote:

> How can I exclude a vector of integers being chosen from sample function.
>  
> For example:
>  
> 1st Run.
>  
> s=sample(1:10,3)
>  
> print( s )
>  
> [1] 5 2 3
>  
> Now I would like to use sample again but to exclude the posibility of the 
> already picked numbers being drawn. I work on very large vectors and as such 
> I would like to make use of the vector the are stored in( which in our case 
> is "s”)
>  
> Thank you for your time.
>  
>  
>  
> _______________________________________________
> igraph-help mailing list
> address@hidden (mailto:address@hidden)
> https://lists.nongnu.org/mailman/listinfo/igraph-help






reply via email to

[Prev in Thread] Current Thread [Next in Thread]