-
Notifications
You must be signed in to change notification settings - Fork 2
/
home_location.R
28 lines (18 loc) · 876 Bytes
/
home_location.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
library("tidyverse")
# load data ---------------------------------------------------------------
# NA is valid country code, stands for Namibia, so should not be read as NA
countries <- read_csv("data/countries.csv", na = "")
home_cities <- read_csv("data/home_cities_frequent.csv.gz", na = "")
# data preparation -------------------------------------------------------
countries[!complete.cases(countries), ]
home_cities[!complete.cases(home_cities), ]
home_cities %>%
group_by(country_code, city) %>%
summarize(num_coord_per_city = n_distinct(long, lat)) %>%
filter(num_coord_per_city > 1)
# proceed to next step ----------------------------------------------------
# source("workshop_tools.R")
# proceed_to("0_cleaned_check")
# return to beginning -----------------------------------------------------
# source("workshop_tools.R")
# proceed_to("master")