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
• 10,620 points
442 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,700 points

Related Questions In Data Analytics

+3 votes
2 answers

Error: could not find function - R Programming

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

answered Aug 23, 2019 in Data Analytics by anonymous
• 33,030 points
33,703 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
• 10,620 points
566 views
0 votes
1 answer

understanding sapply function in r

Do you read 2? sapply. Either a ...READ MORE

answered Jun 24, 2022 in Data Analytics by Sohail
• 3,040 points
578 views
0 votes
2 answers

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

The function match works on vectors : x <- sample(1:10) x # ...READ MORE

answered Dec 12, 2020 in Data Analytics by Rajiv
• 8,870 points
56,633 views
+10 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 9, 2018 in Data Analytics by Abhi
• 3,720 points
1,627 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,840 points
736 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,700 points
1,333 views
+1 vote
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,700 points
1,730 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