Why & How to Set a Random Seed in R (Example) | set.seed Function | Generate & Draw Random Numbers

preview_player
Показать описание
R code of this video:

rpois(5, 3) # Generate random numbers without seed

rpois(5, 3) # Generate random numbers again

rpois(5, 3) # Generate random numbers with seed

rpois(5, 3) # Generate random numbers with same seed

Follow me on Social Media:
Рекомендации по теме
Комментарии
Автор

I am new to R and my hats off as you always clarify things unlike many who talk stupid things.

awaisanwar
Автор

Thank you for the video! This video was super helpful in explaining the concept.

samthenextgeneration
Автор

Thanks man, you got a new subscriber!!

zekken
Автор

Hey, thanks for the video! Btw, can we add any number into the set.seed function or must it related to the dataset?

arjoont
Автор

hey! amazing video. a doubt so if we reproduce the same data with set.seed on different devices/computers do we all get the same results? or different?

asnibre
Автор

It was a great video
However i need to know what if I know the answer but I want to show in R by generating it randomly which number should I give or I just have to see by giving seed a random number set.seed( 10000)
In short how to set seed to get the answer does what does seed(12345) says

samramushtaq
Автор

Hi i have to set pseudo random numbers for 20 randomly selected data points using r programming
set.seed(123)
df1 <- df[sample(nrow(df), 20), ]
View(df1)
is this correct ?

HarpreetKaur-bxej
Автор

Hi, thanks for the video. But it still puzzles me, why do we need to have the same random number by setting the set seed? And, is there any principle on set seed? can i set seed () whatever number I want or does it need to relate to dataset?

jiancanliu
Автор

Kindly dont add text in your videos, we cant see the console.

jawad