Data Structures in R Flashcards

1
Q

5 Basic Data Structures in R?

A

Vector, Factor, List, Matrix, Data Frame

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

A type of array that is one-dimensional.

A

Vector

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

How to create a vector using syntax?

A

c(<element>)</element>

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

Refers to a statistical data type used to store categorical variables.

A

Factor

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

What syntax do you use to create a factor?

A

factor(<vector>)</vector>

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

What additional arguments do you add to create an ordered factor?

A

Ordered and Levels

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

This is the best choice to use when data cannot be represented as an array or a data frame.

A

list

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

What syntax do you use in creating a list?

A

list(<arguments>)</arguments>

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

Is a two-dimensional array of numbers having a fixed numbers of rows and columns.

A

Matrix

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

What syntax do you use to create a matrix directly from a data frame?

A

table(<vector>, <vector>)</vector></vector>

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

Is a table or a two-dimensional array-like structure in which each column contains values of one varibale and each row contains one set of values from each column.

A

Data Frame

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

4 characteristics of Data Frame

A

Column names should be non-empty, row names should be unique, data stored in a data frame can be numeric, factor or character type, and each column should contain same number of data items

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

This operator is used to denote multiple conditions.

A

&

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

This function determines the number of rows in an object such as matrix, data frame, or even a dataset.

A

nrow

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

The syntax to use when creating a subset?

A

subset(<dataname>, <condition>)</condition></dataname>

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