R Beginner Flashcards

1
Q
Addition: 
Subtraction: 
Multiplication: 
Division: 
Exponentiation: 
Modulo:
A
Addition: +
Subtraction: -
Multiplication: *
Division: /
Exponentiation: ^
Modulo: %%
The modulo returns the remainder of the division of the number to the left by the number on its right, for example 5 modulo 3 or 5 %% 3 is 2.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

assign a value 4 to a variable my_var

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

Error: non-numeric argument to binary operator

A
# Assign a value to the variable my_apples
my_apples
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

numerics.
integers.
logical.
characters.

A

Decimal values like 4.5 are called numerics.
Whole numbers like 4 are called integers. Integers are also numerics.
Boolean values (TRUE or FALSE) are called logical.
Text (or string) values are called characters.
Note how the quotation marks in the editor indicate that “some text” is a string.

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

check the data type of a variable

A
# Declare variables of different types
class(my_numeric)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a Vector

A

Vectors are one-dimension arrays that can hold
numeric data,
character data,
or logical data.
In other words, a vector is a simple tool to store data.

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

Naming a vector

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

Sum two vectors

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

Vector selection.

selecting items out of a vector

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

Vector selection.

selecting items 2 to 4

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

Vector selection:

using names

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
for less than
for greater than
for less than or equal to
for greater than or equal to
for equal to each other
not equal to each other
A
< for less than
> for greater than
<= for less than or equal to
>= for greater than or equal to
== for equal to each other
!= not equal to each other
How well did you know this?
1
Not at all
2
3
4
5
Perfectly