Week 3 - Data wrangling Flashcards

1
Q

Name the variable types

A
int
db
num
chr
logi
factor
date/dttm
I don't need charizard. Link for days.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does filter do?

filter(var %in% c(“PRCP”, “TMAX”, “TMIN”))

A

It takes the column named var, and only shows rows where prcp tmax and tmin occur.

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

How do I order a table by a certain column?

A

use the arrange function.

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

How to choose only certain variables?

A

Use select. E.g.
airport %>%
select(AIRPORT, LATITUDE, LONGITUDE, AIRPORT_IS_LATEST, DISPLAY_AIRPORT_NAME)

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

What does mutate do?

A

Allows you to create new, or transform existing variables.

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

What do these do:
%/%
%%

A

%/% Integer division

%% Remainder (mod)

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

What function to use to calculate quantities on a column?

A

Summarise

mean, median, sd, min max etc.

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

How to group and ungroup data?

A
Using group_by()
  group_by(word) %>%
  summarise(m = mean(value), s = sd(value), 
            mx = max(value), mn = min(value))

using ungroup()

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

What are the types of joins?

A

Left / right join

Inner / outer

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