basic

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/39

encourage image

There's no tags or description

Looks like no tags are added yet.

40 Terms

1
New cards

R code chunks in R Markdown

Sections where R code can run inside the document ({r} ...).

2
New cards

Purpose of R Markdown

Combine text + code to create reproducible reports (PDF/HTML/Word).

3
New cards

echo=FALSE

Hides the code, but shows the results.

4
New cards

eval=FALSE

Shows code but does not execute it.

5
New cards

message=FALSE and warning=FALSE

Hides messages & warnings in the output.

6
New cards

cache=TRUE

Reuses previously stored results to speed up knit time.

7
New cards

How to plot a graph with hidden code

```{r, echo=FALSE, message=FALSE, warning=FALSE}
8
New cards

Importance of version control

Tracks changes, rollback versions, supports collaboration & branching.

9
New cards

Initial Git configuration commands

git config --global user.name "Name"
git config --global user.email "email"
10
New cards

git fetch

Downloads changes from remote — does not merge.

11
New cards

git pull

Fetch and merge remote changes into local branch.

12
New cards

git clone URL

Makes a full local copy of a remote repository.

13
New cards

File states in Git

  • Untracked — Git doesn't know it
  • Unmodified — No recent changes
  • Modified — Changed locally
  • Staged — Ready for commit
14
New cards

After committing a file, its status

Unmodified.

15
New cards

Why use branching?

Develop features/experiments without affecting main working code.

16
New cards

Command to check file status

git status.

17
New cards

How to ignore files in Git

Add patterns to .gitignore.

18
New cards

Difference between redirect and append

> — overwrite
>> — append

19
New cards

Pipe operator in Linux

| — send output of one command to another.

20
New cards

chmod 700 file

Only owner can read, write, execute.

21
New cards

Main atomic data types in R

numeric, character, logical, integer, complex.

22
New cards

Difference: NA vs NULL vs NaN

  • NA = missing value
  • NULL = no value / empty
  • NaN = "not a number" (e.g., 0/0).
23
New cards

What is a pure function?

Output depends only on inputs, no side effects.

24
New cards

Anonymous function

A function with no name, usually inline:

function(x) x^2

.

25
New cards

Create a sequence from 0 to 100 by 2

seq(0, 100, by=2).

26
New cards

Repeat 1 three times

rep(1, 3).

27
New cards

Main indexing start in R

1 (not 0!).

28
New cards

What does %>% do?

Pipes data into the next function.

29
New cards

Functions of filter(), select(), mutate(), summarise(), arrange()

  • filter — subset rows
  • select — choose columns
  • mutate — new columns
  • summarise — collapse to summary row(s)
  • arrange — reorder rows.
30
New cards

Extract airline, model, tailnum & manufacturer for dest="IAH" (concept)

Join flights + planes + airlines, then filter dest == "IAH".

31
New cards

What does anti-join do?

Returns rows in left table with no match in right table.

32
New cards

How does inner join work?

Only retains rows with matching key values in both tables.

33
New cards

apply vs sapply vs tapply vs mapply

  • apply — matrix dims
  • sapply — simplify results
  • tapply — apply by group
  • mapply — multiple vectors.
34
New cards

Difference between ggplot() and plot()

ggplot uses layered grammar of graphics; plot is single-call base graphics.

35
New cards

Basic scatter in ggplot

ggplot(df, aes(x,y)) + geom_point()

.

36
New cards

Good plotting practices

Clear labels, avoid clutter, focus on one message.

37
New cards

What is facetting used for?

Split into multiple small plots by a grouping variable.

38
New cards

for loop vs while loop

for = iteration over fixed sequence
while = runs until condition false.

39
New cards

What is an error message?

Code cannot run until the issue is corrected.

40
New cards

Steps to load, examine, arrange, analyse

read.csv() → head()/summary() → tidyverse verbs → plots/models.