-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinaturalist_sample_plotter.R
More file actions
65 lines (39 loc) · 1.79 KB
/
Copy pathinaturalist_sample_plotter.R
File metadata and controls
65 lines (39 loc) · 1.79 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# make static maps of iNaturalist csv data
# created by WRF 2023-06-19
library(maps)
library(ggplot2)
sample_data_file = "~/git/oceanography_scripts/data/observations-337199.csv"
sample_data = read.csv(sample_data_file)
head(sample_data)
table(sample_data$coordinates_obscured)
# is_in_thailand = sample_data$time_zone=="Hanoi"
is_cots = sample_data$scientific_name=="Acanthaster"
#table(is_in_thailand)
sample_data.thai = sample_data[is_in_thailand]
sample_data.cots = sample_data[is_cots]
TL_cots_lat = c(7.580)
TL_cots_lon = c(98.522)
table(sample_data$observed_on)
worldpolygons = map_data("world")
ggplot(worldpolygons) +
coord_cartesian(xlim = c(70,130), ylim = c(-5,25), expand = c(0,0)) +
labs(x=NULL, y=NULL) +
theme(axis.text = element_blank(),
axis.ticks = element_blank(),
legend.position=c(0.75,0.75) ) +
geom_polygon( aes(x=long, y = lat, group = group), fill="#aaaaaa", colour="#ffffff") +
annotate("rect", xmin = 98, xmax = 103, ymin = 8, ymax = 15, fill=NA, colour="black", size=2 ) +
annotate("point", x = TL_cots_lon, y = TL_cots_lat, fill="#f5d900", colour="black", shape=21, size=5 )
ggsave("~/project/crown_of_thorns_starfish/indo_pacific_map.png", device = "png", width = 8, height = 4, units = "in", dpi = 90)
ifelse(sample_data$coordinates_obscured, sample_data$private_latitude, sample_data$latitude)
ifelse(sample_data$coordinates_obscured, sample_data$private_longitude, sample_data$longitude)
sample_data$coordinates_obscured
ggplot(worldpolygons) +
coord_cartesian(xlim = c(95,105), ylim = c(5,15), expand = c(0,0)) +
labs(x=NULL, y=NULL) +
theme(axis.text = element_blank(),
axis.ticks = element_blank(),
legend.position=c(0.75,0.75) ) +
geom_polygon( aes(x=long, y = lat, group = group), fill="#aaaaaa", colour="#ffffff")
#
#