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 in Data Analytics by shradha
34 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 by anonymous
• 31,840 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 23 in Data Analytics by Debasmita Das
239 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,020 points

edited Apr 12, 2018 by kappa3010 40 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
647 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,690 points
585 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
116 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
161 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
87 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
106 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 in Data Analytics by anonymous
• 31,840 points
72 views
0 votes
1 answer

How to create a Heatmap in R?

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

answered Nov 3 in Data Analytics by Cherukuri
• 31,840 points
31 views