[R] uniform number

Rolf Turner r.turner at auckland.ac.nz
Mon May 5 11:19:26 CEST 2014



Please keep responses on-list unless there are compelling reasons not to.

It is still not clear what you want to do.  You *might* want to assign
probabilities to the edges of a graph where these probabilities are 
uniformly (and independently) distributed on the interval [0.01, 0.10].

This could be done by

probs <- runif(n,0.01,0.10)

where "n" is the number of edges.  See ?runif.

You *might* want to assign probabilities either 0.01 or 0.10 to each 
edge of the graph, each probability being chosen with probability 0.5 
(???).  This could be done by

probs <- sample(c(0.01,0.10),n,TRUE).

You really need to learn something about R if you are going to use R.
Start with "An Introduction to R" available (under "Manuals") from the R 
web site.

You also need to learn to express yourself clearly and unambiguously. 
Do not expect your readers to be telepathic.

cheers,

Rolf Turner

On 05/05/14 19:41, Ragia Ibrahim wrote:
>
> thanks for replying
> in the following paper
> http://www.cs.cornell.edu/home/kleinber/kdd03-inf.pdf
> page 6 third paragraph
>
>
> the author writes:
> "assigned a uniform probability of p to each edge of the graph, choosing
> p to be 1% and 10%
> in separate trials."
>
>
> how to use R function to get such probability ?
> Regards
>
>
>  > Date: Mon, 5 May 2014 19:27:43 +1200
>  > From: r.turner at auckland.ac.nz
>  > To: ragia11 at hotmail.com
>  > CC: r-help at r-project.org
>  > Subject: Re: [R] uniform number
>  >
>  > On 05/05/14 17:05, Ragia Ibrahim wrote:
>  > >
>  > > Dear group,
>  > > How to generate uniform probability choosing p to be 2% and 5%, in
> separate trials for 100 times.
>  >
>  > No idea WTF you are talking about. Can you formulate a question that is
>  > comprehensible to the human mind?



More information about the R-help mailing list