Question: Since DAT 3 0 1 is the prerequisite, this course assumes prior familiarity with the R programming language. The first couple of questions are just

Since DAT301 is the prerequisite, this course assumes prior familiarity with the R programming language.
The first couple of questions are just a warm-up in R syntax.
Question 1
Create a variable x as a vector of first 100 natural numbers 1,2,3,dots,100
In addition, create a variable y as a vector of squares of first natural numbers: 12,22,32,dots,1002.
# your code here
fail() # No Answer - remove if you provide an answer
# check whether you created vectors x and y, which are numeric and of length 100
library(testthat) #in case you forgot to run the first cell (but please run it anyways)
if (test_that ",
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="",
expect_equal (is.numeric (x), TRUE)
 Since DAT301 is the prerequisite, this course assumes prior familiarity with

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!