Week 3 - Data wrangling Flashcards
Name the variable types
int db num chr logi factor date/dttm I don't need charizard. Link for days.
What does filter do?
filter(var %in% c(“PRCP”, “TMAX”, “TMIN”))
It takes the column named var, and only shows rows where prcp tmax and tmin occur.
How do I order a table by a certain column?
use the arrange function.
How to choose only certain variables?
Use select. E.g.
airport %>%
select(AIRPORT, LATITUDE, LONGITUDE, AIRPORT_IS_LATEST, DISPLAY_AIRPORT_NAME)
What does mutate do?
Allows you to create new, or transform existing variables.
What do these do:
%/%
%%
%/% Integer division
%% Remainder (mod)
What function to use to calculate quantities on a column?
Summarise
mean, median, sd, min max etc.
How to group and ungroup data?
Using group_by() group_by(word) %>% summarise(m = mean(value), s = sd(value), mx = max(value), mn = min(value))
using ungroup()
What are the types of joins?
Left / right join
Inner / outer