Question: Make sure your R code for part C passes all test provided by: ## check whether function ptypelerr is defined if ( test _ that

Make sure your R code for part C passes all test provided by:
## check whether function ptypelerr is defined
if(test_that(desc="", code={
expect_equal(exists("ptypellerr", mode="function"), TRUE)
})!= TRUE) stop("Function ptypellerr not created!")
## check whether output is numeric (or double)
if (test_that(desc="", code
expect_equal (is.numeric(ptypellerr (p=0.15,k=2)), TRUE)
})!= TRUE) stop("the output is not numeric/double.")
And
## check whether the 3 rd,4 th and 5 th digit of ptypellerr (p=0.23,k=5) are 0,4,5, respectively
if (test_that(desc="", code={
expect_equal ( floor * ptypeller. (p=0.23,k=5))%%1000==45, TRUE)
})!= TRUE) stop("Sorry, wrong answer")
## check whether the 4 th and 5 th digit of ptypellerr (p=0.28,k=4) are 3,9, respectively
if (test_that(desc="", code={
expect_equal ( floor ptypellerr {:(p=0.28,k=4))%%100,39
})!= TRUE) stop("Sorry, wrong answer")
## check whether ptypellerr (p=0.15,k=2)==0
if (test_that(desc="", code
expect_equal ( ptypellerr (p=0.15,k=2)==0, TRUE)
})!= TRUE) stop("Sorry, wrong answer")
 Make sure your R code for part C passes all test

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!