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,870 points
36 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 by Tyrion anex
• 8,280 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 in Data Analytics by anonymous
• 31,840 points
5,011 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,870 points
35 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
800 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
1,942 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,040 points
39 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
74 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
81 views