Create random numbers in R

0 votes
How to create random numbers in R?

I want to create a train and text model based on random numbers in dataframe.

Can someone help.
Aug 21, 2019 in Data Analytics by shradha
749 views

1 answer to this question.

0 votes

There are many ways to create a random list or vector.

A few ways are - 

sample.split() 

> x = 1:100
> x[sample.split(1:100,0.65)]

runif() 

> runif(9)
[1] 0.8884359 0.8655232 0.4716199 0.3528265 0.6706695 0.1516020 0.9460111 0.7988518 0.1447018

Take the output of function and create a dataframe using data.frame or as.data.frame().

answered Aug 21, 2019 by anonymous
• 33,030 points

Related Questions In Data Analytics

0 votes
1 answer

create data.frame with random numbers in R

First create a matrix with random numbers ...READ MORE

answered Sep 24, 2019 in Data Analytics by Debasmita Das
3,099 views
0 votes
1 answer

How to create excellent examples in R?

An excellent example must consist of the ...READ MORE

answered Apr 10, 2018 in Data Analytics by kappa3010
• 2,090 points

edited Apr 12, 2018 by kappa3010 759 views
0 votes
1 answer

Sample random rows in DataFrame in R

First we should have some data: df1<-data.frame(matrix(rnorm(20), nrow=10)) > ...READ MORE

answered Apr 13, 2018 in Data Analytics by DeepCoder786
• 1,720 points
8,136 views
0 votes
1 answer

How to create dummy variables based on a categorical variable of lists in R?

You can use mtabulate in the following way: library(qdapTools) cbind(data[1], ...READ MORE

answered Apr 13, 2018 in Data Analytics by CodingByHeart77
• 3,750 points
2,623 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,249 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,919 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,182 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,339 views
0 votes
2 answers

How to create a table in R without external file?

Tibble also creates a table-like structure. Use below ...READ MORE

answered Sep 3, 2019 in Data Analytics by anonymous
• 33,030 points
3,016 views
0 votes
1 answer

How to create a Heatmap in R?

Its very simple. Use heatmap function and ...READ MORE

answered Nov 3, 2019 in Data Analytics by Cherukuri
• 33,030 points
740 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