Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

We can also write a for - loop to apply a user - defined function 'checkEvent ( ) ' to each row of a matrix

We can also write a for-loop to apply a user-defined function 'checkEvent()' to each row of a matrix object 'simulatedData' as follows:
val = vector(length = nrow(simulatedData))
for (i in 1:nrow(simulatedData)){
val[i]= checkEvent(simulatedData[i,])
}
Which one of the following is TRUE about this approach?
Question 5 options:
It would be computationally expensive if 'simulatedData' is big.
It will work only if 'simulatedData' has equal number of rows and columns.
It will work only if 'simulatedData' is a matrix of numerical values.
It will take a similar computational time as using the apply() function but the code will be a bit bigger.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sams Teach Yourself Beginning Databases In 24 Hours

Authors: Ryan Stephens, Ron Plew

1st Edition

067232492X, 978-0672324925

More Books

Students also viewed these Databases questions

Question

Define promotion.

Answered: 1 week ago

Question

Write a note on transfer policy.

Answered: 1 week ago

Question

Discuss about training and development in India?

Answered: 1 week ago

Question

Explain the various techniques of training and development.

Answered: 1 week ago

Question

to encourage a drive for change by developing new ideas;

Answered: 1 week ago

Question

4 What are the alternatives to the competences approach?

Answered: 1 week ago