T2: R Project management + R basis conts Flashcards

1
Q

Debugging

A

1) Read the error message
2) Pay attention to the line
3) Try to see if you can fix it yourselves
4) Google/Stack overflow

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

SOME PRINCIPLES OF
COLLABORATION

A

Data management:
* Keep raw data
* Document all steps of data
* Use a comprehensive and global name
convention

Coding (Software):
* Comment code
* Structure code
* Write modular code
* Avoid redundancy
* Use a comprehensive and global name convention (again!)
* Use a common repository
* Use one common to-do list

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

Loading Data

A

Function: read.csv()
* Used to read comma-separated files.
* Returns data in a data frame format.

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

Viewing Data

A

Functions: head(), View()
* head(): View the first few rows of the
dataset.
* View(): Opens a detailed viewer for the
data.

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

Dimensions & Structure

A

Functions: nrow(), ncol()
* nrow(): Returns the number of rows.
* ncol(): Returns the number of columns.
Useful to understand the size of your dataset.

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

Summary Statistics

A

Function: summary()
* Get basic statistics for numeric columns.
* Counts for categorical columns.

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

Data Visualization

A

Function: hist()
* Important to visualize distributions before any
advanced analysis to understand your data
* E.g., the spread and central tendency

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

Subsetting Data

A

Function: subset()
* Filter rows based on conditions.
* Focus on specific segments of data.

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

Grouped Operations

A

Functions: table(), tapply()
* table(): Count occurrences in categorical
data.
* tapply(): Apply functions to subsets.

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

Hypothesis Testing

A

Function: t.test()
* Compare means of two groups.
* Check if differences are statistically
significant.

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

WRITING A FUNCTION

A

[function_name] <- function(arg1,
arg2, …) { Function body
}

Return or not
return: * f.square(7)
* xx <- f.square(7)

Example:
f.square <- function(arg1)
{ return(arg1^2)
}

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