Week 1 Day 2 Flashcards

1
Q

What is the R command for equality?

A

==

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

What is the R command for inequality?

A

!=

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

What is the R command for “is this true AND is this true?”

A

&

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

What is the R command for “is EITHER this true OR this true?”

A

| (not capital I)

(not capital i).

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

What is the R command for “is this NOT true?”

A

!

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

Do all functions in R have an argument?

A

Yes.

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

What does this mean: round (4.9384,3)?

A

Round 4.9384 to 3 decimal places.

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

Do arguments for R functions also have names?

A

Yes.
e.g. round () argument, has arguments with the following names: x and digits.
e.g. round ( x = 3.254, digits = 1).

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

What is “nesting”?

A

Functions using other functions as arguments.

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

What are vectors?

A

Vectors are variables that store multiple bits of information. Think of variables as boxes that store items. Vectors are like a sequence of boxes (variables), which each contain values (inside variables), like a shelf.

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

How do you create a vector in R?

A

Using the function c( ).
e.g. theNextThreeYears <- c(2025, 2026, 2027)

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

Can you have have multiple classes in a vector? e.g. words and numbers, or numbers and logicals?

A

No. R will convert everything into the same class, but will not let you know. “silent fail”.

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