wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Day-3 Assessment(Essentials of Data Analytics Using R)

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

Point out the correct statement?

a)

Blocks are evaluated until a new line is entered after the closing brace

b)

Single statements are evaluated when a new line is typed at the start of the syntactically complete statement

c)

The if/else statement conditionally evaluates two statements

d)

Break will execute a loop while a condition is true

2.

Which of the following R syntax is correct for while loop?

a)

while ( statement1 ) statement2

b)

while ( statement1 ) else statement2

c)

while ( statement1 ) do statement2

d)

while ( statement2 ) doelse statement2

3.

Point out the wrong statement?

a)

for will execute a loop a fixed number of times

b)

break will execute a loop while a condition is true

c)

if and else tests a condition and acting on it

d)

break is used to break the execution of a loop

4.

Which loop executes a sequence of statements multiple times and abbreviates the code that manages the loop variable?

a)

repeat

b)

for

c)

while

d)

do-while

5.

Which of the following true about for loop?

a)

Repeats a statement or group of statements while a given condition is true. It tests the condition before executing the loop body.

b)

it tests the condition at the end of the loop body.

c)

Both A and B

d)

None of the above

6.

Which statement simulates the behavior of R switch?

a)

Next

b)

Previous

c)

break

d)

goto

7.

Which of the following character skip during execution?

a)

D

b)

C

c)

A

d)

B

8.

What will be output for the following code?

a)

A

b)

ABC

c)

ABCD

d)

AA

9.

 What will be output for the following code?

a)

A

b)

NAN

c)

NA

d)

Error

10.

getwd() is used

a)

to see current directory

b)

to set current directory

c)

to change current directory

d)

not a R command

11.

library(datasets) is used

a)

to load external datasets

b)

to load builtin datasets

c)

Error

d)

Wrong

12.

?datasetName is used

a)

to take help, more info about datasetName

b)

to take remove datasetName

c)

to load datasetName

d)

can't use in R

13.

which is not a type of functon in R?

a)

infix

b)

primitive

c)

replaceement

d)

external

14.

ifelse(T==TRUE, "I knew it!", "Yes")

a)

I knew it!

b)

Yes

c)

Not a valid statement

d)

Error

15.

if else(T==TRUE, "I knew it!", "Yes")

a)

I knew it!

b)

Yes

c)

"I knew it!"

d)

Error