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 in Data Analytics by Sophie may
• 9,050 points
22 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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 by Tyrion anex
• 8,280 points

Related Questions In Data Analytics

0 votes
1 answer

Error: could not find function - R Programming

This error usually occurs when a package ...READ MORE

answered Oct 29, 2018 in Data Analytics by Maverick
• 10,000 points
115 views
0 votes
1 answer

Report function outputs in R programming

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

answered Jan 14 in Data Analytics by Sophie may
• 9,050 points
22 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,690 points
71 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
651 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,000 points
13 views
0 votes
1 answer
+4 votes
2 answers
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,280 points
52 views
0 votes
1 answer

R programming: glm() function

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

answered Jan 23 in Data Analytics by Tyrion anex
• 8,280 points
25 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.