[R] conditional probability removal
boris.steipe at utoronto.ca
Thu Apr 17 22:17:20 CEST 2014
I think the discussion in this thread
See the parameter "prob" of sample.
On 2014-04-17, at 4:07 PM, Charles Determan Jr wrote:
> I would like to randomly remove elements from a numeric vector but with
> different probabilities for higher numbers.
> For example:
> dat <- sample(seq(10), 100, replace=T)
> # now I would like to say randomly remove elements but with a higher chance
> of removing elements >= 5 and even greater for elements >= 8.
> I am unfamiliar if there is a way to define conditional probabilities. Any
> insight would be appreciated.
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help