Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)
image text in transcribed

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

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

=+What kinds of problems need to be overcome?

Answered: 1 week ago