[R] proportional sampling
jholtman at gmail.com
Fri Apr 27 14:20:23 CEST 2007
sample(df$ID, numOfTime, replace=TRUE, prob=df$Factor)
On 4/27/07, tibi.codilean at ges.gla.ac.uk <tibi.codilean at ges.gla.ac.uk> wrote:
> Dear All,
> I wonder if you could help me.
> I have a table with a series of sites that I would like to sample from.
> The table has 5 columns:
> X Coordinate
> Y Coordinate
> The conditions are that each site can be selected more than once and the
> probability of it being selected (or sampled) is proportional to a factor
> located in column 'Factor'
> I am novice in terms of R, and am not entirely sure how to do the
> proportional sampling.
> Any help would be appreciated
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
+1 513 646 9390
What is the problem you are trying to solve?
More information about the R-help