[R] choose randomly

2019-12-18 Thread Medic
Bert, I am very grateful for your clear explanation!!! Bert Gunter If n = N, then this is unnecessarily complicated. sample(mydata$Temperature) is all you need (see ?sample). If n < N, then the "trick" is not done. sample(mydata$Temperature, n) is what is wanted. Bert Thank you, Ji

Re: [R] choose randomly

2019-12-18 Thread Bert Gunter
If n = N, then this is unnecessarily complicated. sample(mydata$Temperature) is all you need (see ?sample). If n < N, then the "trick" is not done. sample(mydata$Temperature, n) is what is wanted. Bert On Wed, Dec 18, 2019 at 12:54 PM Jim Lemon wrote: > Hi Medic, > mydata$Temperature[sam

Re: [R] choose randomly

2019-12-18 Thread Jim Lemon
Hi Medic, mydata$Temperature[sample(1:N,N) should do the trick. You will just get a pseudo-randomly shuffled set of the same values. Jim On Thu, Dec 19, 2019 at 7:34 AM Medic wrote: > > Variable temperature: > mydata$temperature > has N values. > With what code to сhoice (without return) n value

[R] choose randomly

2019-12-18 Thread Medic
Variable temperature: mydata$temperature has N values. With what code to сhoice (without return) n values from them RANDOMLY? __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read