Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

library ( testthat ) #in case you forgot to run the first cell ( but please run it anyways ) if ( test _ that

library(testthat) #in case you forgot to run the first cell (but please run it anyways)
if (test_that(desc="", code={
expect_equal(is.vector(x), TRUE)
expect_equal(is.vector(y), TRUE)
})!= TRUE) stop("Sorry, x or y was not created as a vector")
if (test_that(desc="", code={
expect_equal(is.numeric(x), TRUE)
expect_equal(is.numeric(y), TRUE)
})!= TRUE) stop("Sorry, x or y is not numeric")
if (test_that(desc="", code={
expect_equal(length(x),100)
expect_equal(length(y),100)
})!= TRUE) stop("Sorry, wrong length for at least one of the vectors")

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

Icdt 88 2nd International Conference On Database Theory Bruges Belgium August 31 September 2 1988 Proceedings Lncs 326

Authors: Marc Gyssens ,Jan Paredaens ,Dirk Van Gucht

1st Edition

3540501711, 978-3540501718

More Books

Students also viewed these Databases questions

Question

What developmental needs does Tyler appear to have?

Answered: 1 week ago