R programming Flashcards

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

A

x[r,c]

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)

A

x[r,]

21
Q

prints the nth member of the list

A

x[[n]]

22
Q

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

A

data frame

23
Q

must have every element of the same class

A

matrices

24
Q

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

A

attach ()

25
Q

generates random variable(s) from the Binomial distribution (n, size, prob)

A

rbinom ()

26
Q

generates random variable(s) from the Poisson distribution (n, lambda)

A

rpos()

27
Q

generates random variable(s) from the Normal distribution (n, mean, sd)

A

rnorm()

28
Q

used to allow reproducibility of randomly generated value.

A

set.seed()

29
Q

What is abline

A

add more straight lines

30
Q

How to download packages

A

install.packages()

31
Q

executes two possible results depending on the result of a logical condition

A

if function

32
Q

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.)

A

for loops

33
Q

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.

A

while loops

34
Q

True or False.

Functions can be passed as arguments to other functions.

A

True

35
Q

True or False.
Functions can’t be nested

A

False

36
Q

the arguments included in the function definition.

A

formal arguments

37
Q

How to define a function

A

1.Function name (be specific).
2.Arguments of the function.
3.What the function does.