Question: Make sure code for part B passes all test provided by the following code: ## check whether function ptypelerr is defined if ( test _

Make sure code for part B passes all test provided by the following code:
## check whether function ptypelerr is defined
if (test_that(desc="", code
expect_equal(exists("ptypelerr", mode="function"), TRUE)
})!= TRUE) stop("Function ptypelerr not created!")
## check whether output is numeric (or double)
if (test_that(desc="", code
expect_equal(is.numeric(ptypelerr (p=0.15,k=2)), TRUE)
})!= TRUE) stop("The output is not numeric/double.")
And
## check whether the 3rd,4th and 5 th digit of ptypelerr (p=0.15,k=2) are 1,4,1, respectively
if (test_that(desc="", code
expect_equal( floor(10^5* ptypelerr (p=0.15,k=2))%1000,141)
})!= TRUE) stop("Sorry, wrong answer")
## check whether the 4th and 5th digit of ptypelerr (p=0.10,k=6) are 2,4, respectively
if (test_that(desc="", code
expect_equal ( floor * ptypelerr (p=0.10,k=6))%%100,24)
})!= TRUE) stop("Sorry, wrong answer")
 Make sure code for part B passes all test provided by

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!