I have the following data frame 

```
ID <- c(1,2,3,4,5,6)
pop <- c(10,10,10,10,1000,1000)
df <- data.frame(pop,ID)

```

Now I would like to draw unique ID's from this data frame with the condition, that the probability, that I draw an ID with a population of larger or equal of 1000 being 0.1 and that the probability for drawing an ID with a population of lower than 1000 being 0.9. 

This is the code, that I have come up with: 

```
sample(c(df$ID[df$pop>=1000],df$ID[df$pop<1000]),3, prob=c(0.1,0.9))

```

However, I get the following error message: 

```
Error in sample.int(length(x), size, replace, prob) : 
  incorrect number of probabilities

```

How can I rewrite this problem so it works without assigning a probability to every ID?