Hello
If I have this vector x=c(5,1,2,9) and n=length(x) and I want to sample one value from x , and each value of x has equal probability to appear (1/n).
Are the following codes equivalent??
sample(x,1,replace=TRUE)  and   sample(x,1,replace=TRUE,prob=rep(1/n , n))
 
Regards
	[[alternative HTML version deleted]]

