Week 2 Flashcards

1
Q
A

‘x’ is a vector of length 10 and ‘if’ can only test a single logical statement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
A

The number 27 is returned

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
A

f

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is an environment in R?

A

a collection of symbol/value pairs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The R language uses what type of scoping rule for resolving free variables?

A

Lexical scoping

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How are free variables in R functions resolved?

A

The values of free variables are searched for in the environment in which the function was defined

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is one of the consequences of the scoping rules used in R?

A

All objects must be stored in memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In R, what is the parent frame?

A

It is the environment in which a function was called

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

control structures in R allow you to…

A

control the flow of execution of the program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

if/else

A

testing a condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

for

A

execute a loop a fixed number of times

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

while

A

execute a loop while a condition is true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

repeat

A

execute an infinite loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

break

A

break the execution of a loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

next

A

skip an interaction of a loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

return

A

exit a function

17
Q

how to write an if/else statement

A
18
Q
A