-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_bad_locs.R
31 lines (23 loc) · 867 Bytes
/
get_bad_locs.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
29
30
31
require(dplyr)
sample_plot <- function(s="easia0"){
a <- read.table(sprintf("subset/%s.polygon",s ))
b <- read.csv(sprintf("subset/%s.pop_geo", s))
require(maps)
plot(a, type='l', col=2); map(add=T)
points(b[,3:2], col=3)
}
get_uncertain_dudes <- function(){
s="easia0"
b <- read.csv(sprintf("subset/%s.pop_geo", s))
locs <- read.csv("locations_all.csv")
m <- merge(locs,b, by.x='ID', by.y='popId')
locs %>% filter(Certainty.group!=1) %>%
select(ID) %>% unlist() %>%
cat(file="easia_certainty_1.txt", sep=",")
locs %>% filter(Certainty.group %in% c(2,3)) %>%
select(ID) %>% unlist() %>%
cat(file="easia_certainty_2.txt", sep=",")
locs %>% filter(Certainty.group %in% c(2)) %>%
select(ID) %>% unlist() %>%
cat(file="easia_certainty_3.txt", sep=",")
}