What is set seed in R

0 votes
What is set.seed () in R? why is it used in regression and k-means clustering?
Jul 9, 2019 in Data Analytics by riya
40,720 views

1 answer to this question.

0 votes

Let me explain in simple words,

set seed (value) where value specifies the initial value of the random number seed.

Syntax: set.seed(123)

In the above line,123 is set as the random number value.

The main point of using the seed is to be able to reproduce a particular sequence of 'random' numbers. and sed(n) reproduces random numbers results by seed.

For more information for set.seed() read below pdf of few pages that explains all about set.seed() in detail.

https://www.stata.com/manuals13/rsetseed.pdf

When the k-means clustering algorithm runs, set.seed() is used a randomly generated seed to determine the starting centroids of the clusters.

answered Jul 9, 2019 by anonymous
• 33,030 points
Thanks for the info,  can you provide example with small data set?
Hi@Sarfaraz,

Please go through the above-given link. You will get some good examples.

Related Questions In Data Analytics

0 votes
1 answer
0 votes
1 answer

Why should I use set.seed function() in R?

set.seed(seed) Set the seed of R‘s random number ...READ MORE

answered Apr 24, 2018 in Data Analytics by zombie
• 3,790 points
1,818 views
0 votes
1 answer

What is the standard naming convention for the variables in R?

Use of period separator e.g. product.prices <- c(12.01, ...READ MORE

answered Apr 25, 2018 in Data Analytics by shams
• 3,670 points
657 views
0 votes
1 answer

What is the difference between library () and require () functions in R ?

 library() require() Library () function gives an error message ...READ MORE

answered Sep 5, 2018 in Data Analytics by zombie
• 3,790 points
2,652 views
0 votes
1 answer

By using dpylr package sum of multiple columns

Basically here we are making an equation ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
2,256 views
0 votes
1 answer

How to convert a text mining termDocumentMatrix into excel or csv in R?

By assuming that all the values are ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
1,928 views
0 votes
1 answer

In a dpylr pipline how to use sample and seq?

For avoiding rowwise(), I prefer to use ...READ MORE

answered Apr 6, 2018 in Data Analytics by DeepCoder786
• 1,720 points

edited Jun 9, 2020 by Gitika 1,186 views
0 votes
1 answer

How to create a list of Data frames?

Basically all we have to do is ...READ MORE

answered Apr 9, 2018 in Data Analytics by DeepCoder786
• 1,720 points
1,348 views
0 votes
2 answers

What is the difference between %% and % in R programming?

HI, %% returns remainder in case of numeric ...READ MORE

answered Aug 26, 2019 in Data Analytics by anonymous
• 33,030 points
2,413 views
0 votes
1 answer

What is the difference between list and vector in R?

The difference are - A list holds different ...READ MORE

answered Oct 29, 2019 in Data Analytics by Cherukuri
• 33,030 points
48,148 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP