R programming Flashcards

(37 cards)

1
Q

Variables can be created using what assignment operator?

A

<- or =

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

True or False (Modified)

Variables are case-sensitive

A

True

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

True or False (Modified)

The data-type of the variables is determined by the type of character stored in the variable.

A

False. Type of data stored

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

What are the three major data types

A

character, numeric, and logical

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

It an object-oriented. A number or a result of an operation inside an object denoted by a variable.

A

Scalar

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

Set elements that usually of the same type or class

A

Vector

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

A unique identifier of the function

A

function-name

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

required input

A

arguments

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

It is a special type of vector that can contain objects of different classes.

A

List

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

It occurs when different objects are mixed in vector, so that every element in the vector is of the same class

A

coercion

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

vectors with a dimension attribute

A

matrices

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

True or False.

a matrix is constructed column-wise. entries can be thought of starting in the upper left corner running down the columns

A

true

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

Represent categorical ddata. It can be unordered or ordered.

A

factor

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

the nth element in a vector

A

x[n]

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

specific elements in a vector x in kth, nth, mth order

A

x[c(k,n,m)]

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

x[m:n]

A

the mth to nth element in vector x

17
Q

x[x>m & x<n]

A

elements between m and n

18
Q

the rth row and cth column of the x matrix

19
Q

the 1st and 3rd row and 4th and 6th column elements of x matrix

A

x[c(1,3), c(4,6)]

20
Q

the entire rth row (including all columns)

21
Q

prints the nth member of the list

22
Q

represented as special type of list where elements of the kist must be the same length

23
Q

must have every element of the same class

24
Q

aside from $ operator in calling variables in data frame, what is the other alternative

25
generates random variable(s) from the Binomial distribution (n, size, prob)
rbinom ()
26
generates random variable(s) from the Poisson distribution (n, lambda)
rpos()
27
generates random variable(s) from the Normal distribution (n, mean, sd)
rnorm()
28
used to allow reproducibility of randomly generated value.
set.seed()
29
What is abline
add more straight lines
30
How to download packages
install.packages()
31
executes two possible results depending on the result of a logical condition
if function
32
take an iterator variable and assign it successive values from a sequence or a vector. It is the most used for iterating over the elements of an object (list, vector, etc.)
for loops
33
begin by testing a condition. If it is true, then they execute the loop body. Once the loop body is executed, the condition is tested again, and so forth.
while loops
34
True or False. Functions can be passed as arguments to other functions.
True
35
True or False. Functions can't be nested
False
36
the arguments included in the function definition.
formal arguments
37
How to define a function
1.Function name (be specific). 2.Arguments of the function. 3.What the function does.