R programming: sapply() function

0 votes
Problem statement: To create a matrix with 100 rows and 20 columns by implementing the sapply()  function. Also, fill the matrix with random variables of values between 0 and 1.

How can this be done?
Jan 23, 2019 in Data Analytics by Sophie may
• 9,940 points
57 views

1 answer to this question.

0 votes

There are 2 ways to do it, try this:

replicate(20, rtriangle(100))
sapply(rep(100, 20), rtriangle)

Hope this helps.

answered Jan 23, 2019 by Tyrion anex
• 8,380 points

Related Questions In Data Analytics

0 votes
2 answers

Error: could not find function - R Programming

Yes, Just like @Maverik said, It happens ...READ MORE

answered Aug 22, 2019 in Data Analytics by anonymous
• 32,460 points
16,290 views
0 votes
1 answer

Report function outputs in R programming

In your case, you've stored the output ...READ MORE

answered Jan 14, 2019 in Data Analytics by Sophie may
• 9,940 points
64 views
0 votes
1 answer

R function for finding the index of an element in a vector?

Yes, we can find the index of ...READ MORE

answered Apr 13, 2018 in Data Analytics by zombie
• 3,750 points
17,341 views
0 votes
1 answer

Which function can I use to clear the console in R and RStudio ?

Description                   Windows & Linux           Mac Clear console                      Ctrl+L ...READ MORE

answered Apr 17, 2018 in Data Analytics by anonymous
13,477 views
+9 votes
3 answers

Which is a better initiative to learn data science: Python or R?

Well it truly depends on your requirement, If ...READ MORE

answered Aug 8, 2018 in Data Analytics by Abhi
• 3,680 points
170 views
+1 vote
2 answers
0 votes
1 answer

R programming logic

Use gsub to match the substring that we want ...READ MORE

answered Nov 16, 2018 in Data Analytics by Maverick
• 10,820 points
62 views
0 votes
1 answer
0 votes
1 answer

R programming: How to pass variables from a r program to mysql function?

To include the R variables called start.date and end.date, you can use paste to ...READ MORE

answered Dec 28, 2018 in Data Analytics by Tyrion anex
• 8,380 points
170 views
0 votes
1 answer

R programming: glm() function

Since you mentioned you have factorized variables, ...READ MORE

answered Jan 23, 2019 in Data Analytics by Tyrion anex
• 8,380 points
387 views