Question: # check whether function ` counts ( ) ` exists # and whether counts ( x ) returns a list of length 2 ( for

# check whether function `counts()` exists
# and whether counts(x) returns a list of length 2(for the input x =-3:6)
x =-3:6
if (test_that(desc="Sorry, functions `counts` was not created correctly", code={
expect_equal(is.function(counts), TRUE)
})!= TRUE) stop("Sorry, functions `counts` was not created correctly")
if (test_that(desc="", code={
expect_equal(length(counts(x)),2)
})!= TRUE) stop("Sorry, for x=-3:6, length of the returned list is not 2")

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!