R basics: Dataframe, for loop and if condition Flashcards

1
Q

what are data frames used for?

A

used to store structured data in tabular format similar to a spreadsheet

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

what do columns contain?

A

each column can contain data of different types, numbers, text, dates etc.

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

what do rows contain?

A

each row is associated with a unique index or identifer.

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

what are dimensions?

A

dimensions are represented as the number of rows and columns.

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

what is the code for dimensions?

A

dim()

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

what is a for loop

A

a for loop is used to iterate over a sequence of elemts and perfomr a set of operations repeatedly

a for loop is a control structure that allows you to execute a block of code multiple times

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

what are the three main components of for loops?

A

Initialization: you specify a variable and set its initial value. this variable is used as a counter during the loop

iteration: After each iteration of the loop, the counter variable is updated according to specified increment or decrement.

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