-
Notifications
You must be signed in to change notification settings - Fork 0
/
.Rhistory
512 lines (512 loc) · 19.3 KB
/
.Rhistory
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
polygs.iww = polygs.iww)
counts <- subset_species(iww.locs = iww.locs,spp = spp)
outputs <- create.polygons(locs.sea,
iww.aggr,
counts,
save.output = F,
spp = spp,
survey.date = survey.date)
plot.title = "Common Scoter IWW counts (March 2020)"
plot.iww.pgons(pgons=outputs$locs.dens,track=data.loaded$track,
plot.title=plot.title)
plot.title = "Common Scoter IWW counts (January 2020)"
plot.title = "Common Scoter IWW counts (January 2020)"
plot.iww.pgons(pgons=outputs$locs.dens,track=data.loaded$track,
plot.title=plot.title)
month <- "03"
#survey.date <- "2020-01-19"
survey.date <- "2020-03-08"
load_VP_data()
locs.iww <- subset_IWW_date(survey.date = survey.date)
locs.sea <- calculate.buffer(locs.iww = locs.iww,
mask = mask,
buffer.size=2)
merge.iww_to_WeBS_polys(iww = iww,
locs.sea = locs.sea,
polygs = polygs)
plot.basic.view(locs.sea = locs.sea,
mask = mask,
locs.iww = locs.iww,
polygs.iww = polygs.iww)
counts <- subset_species(iww.locs = iww.locs,spp = spp)
outputs <- create.polygons(locs.sea,
iww.aggr,
counts,
save.output = F,
spp = spp,
survey.date = survey.date)
plot.title = "Common Scoter IWW counts (March 2020)"
plot.iww.pgons(pgons=outputs$locs.dens,track=data.loaded$track,
plot.title=plot.title)
#month <- "01"
month <- "03"
data.loaded <- load_month_data(month,spp)
# Create a mesh (fishnet) -------------------------------------------------
MESH <- create.mesh(mask = mask,
MaxEdge = 4,
track=data.loaded$track,
obs.model = data.loaded$obs.model)
# Prepare the model -------------------------------------------------------
model.data <- model.prep(obj.list = data.loaded,
jitter.points = TRUE,
MESH = MESH,
priorrange = c(15,0.5),
priorsigma = c(1,0.5))
# Run the spde model ------------------------------------------------------
lgcp.model <- lgcp.spde(modprep.list = model.data)
# Create model predictions in space ---------------------------------------
predictions <- model.predictions(MESH = MESH,lgcp.fit = lgcp.model)
# Save the predictions to the output folder
save.predictions(predicted=predictions$predicted,month = month,spp=spp)
##
#prediction.raster <- readRDS("outputs/Common scoter_month01.rds")
# Plot the predicted distribution -----------------------------------------
plot.abundance(predicted=predictions$predicted,track=data.loaded$track,
plot.title = "Density of Common Scoter (March 2020)",
plot.boundary = T,plot.coastline = T,round.scale = 0)
plot.abundance <- function(predicted,track,plot.title="",plot.boundary=F,
plot.coastline=F,round.scale=0,save.out=T){
breaks<-c(seq(min(predicted$mean),
max(predicted$mean),
(max(predicted$mean)/2)),max(predicted$mean))
labels <- round(breaks,round.scale)
transdf <- data.frame(coordinates(track))
xlims <- c(min(transdf$coords.x1)*0.99, max(transdf$coords.x1)*1.01)
ylims <- c(min(transdf$coords.x2)*0.999, max(transdf$coords.x2)*1.001)
G <- ggplot(predicted, aes(x=x, y=y)) + geom_raster(aes(fill= mean)) +
scale_fill_gradient(trans = 'sqrt', low = "blue", high = "red",
breaks=breaks,
labels=labels,
name=expression(Density~(Ind/km^{"2"}))) +
scale_x_continuous(breaks=seq(425,525,25),label=seq(4.25,5.25,.25))+
scale_y_continuous(breaks=seq(6380,6440,20),label=seq(6.38,6.44,.02))+
xlab(expression(X(meters~x~10^{"6"})))+
ylab(expression(Y(meters~x~10^{"7"})))+
ggtitle(plot.title)+
theme_gdocs()+
theme(
#panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.border = element_rect(colour = "black"),
plot.background = element_blank()
)+
coord_equal(xlim = xlims, ylim = ylims)
if(plot.coastline==TRUE){
print("loading high resolution coastline.. this may take a moment..")
load(file = 'D:/GIS_DATA/UK_coastline.rda')
coastline_sp_utm <- spTransform(tt, UTM30)
coastData_DF <- fortify(coastline_sp_utm)
G <- G +
geom_polygon(aes(x = long, y = lat, group = group), data = coastData_DF, fill = "darkolivegreen3",
col = "grey35", alpha = 0.7)
}
if(plot.boundary==TRUE){
boundary.shape <- readOGR(dsn="./Data/Shapefile/Moray_Firth_Area_WGS84.shp",
layer="Moray_Firth_Area_WGS84")
boundaryUTM30 <- spTransform(boundary.shape,UTM30)
boundary_DF <- fortify(boundaryUTM30)
G <- G +
geom_polygon(aes(x=long,y=lat,group=group),data=boundary_DF,
col="black",alpha=0)
}
if(save.out==T){
oname <- paste0("outputs/",gsub(" ","_",plot.title),".jpeg")
ggsave(filename=oname,plot=G,device="jpeg",width=8,height=6)
}
return(G)
}
# Plot the predicted distribution -----------------------------------------
plot.abundance(predicted=predictions$predicted,track=data.loaded$track,
plot.title = "Density of Common Scoter (March 2020)",
plot.boundary = T,plot.coastline = T,round.scale = 0)
month <- "01"
#month <- "03"
survey.date <- "2020-01-19"
#survey.date <- "2020-03-08"
# Load data ------------------------------------------------------------
data.loaded <- load_month_data(month,spp)
# Create a mesh (fishnet) -------------------------------------------------
MESH <- create.mesh(mask = mask,
MaxEdge = 4,
track=data.loaded$track,
obs.model = data.loaded$obs.model)
# Prepare the model -------------------------------------------------------
model.data <- model.prep(obj.list = data.loaded,
jitter.points = TRUE,
MESH = MESH,
priorrange = c(15,0.5),
priorsigma = c(1,0.5))
# Run the spde model ------------------------------------------------------
lgcp.model <- lgcp.spde(modprep.list = model.data)
# Create model predictions in space ---------------------------------------
predictions <- model.predictions(MESH = MESH,lgcp.fit = lgcp.model)
# Save the predictions to the output folder
save.predictions(predicted=predictions$predicted,month = month,spp=spp)
##
#prediction.raster <- readRDS("outputs/Common scoter_month01.rds")
# Plot the predicted distribution -----------------------------------------
plot.abundance(predicted=predictions$predicted,track=data.loaded$track,
plot.title = "Density of Common Scoter (January 2020)",
plot.boundary = T,plot.coastline = T,round.scale = 0)
# Plot population estimate ------------------------------------------------
plot.pop.priors(pred.list = predictions)
# Get population estimate numerically -------------------------------------
predictions$marginals
source('D:/PROJECTS_CURRENT/SNH_Moray_Firth/SNH_Moray_Firth/scripts/helpers.R')
source("scripts/helpers.R")
RSPBfiles <- list.files("Data/RSPB_data_filtered/",full.names = TRUE)
spp <- "eider"
## Nairn_Culbin_Bars, Outer_Dornoch_Firth, or Inverness_Beauly_Firth
site <- "Outer_Dornoch_Firth"
month <- "DEC"
year <- 2019
predict.to <- c(site = site,
month = month,
year = year)
rspb.data <- wrangle.RSPB.data(spp,save.output=T)
rspb.m <- merge.RSPB.to.WeBS(spp,rspb.data)
rspb.merged <- rspb.m$merged
WeBS.dat <- rspb.m$WeBS
predict.rspb(WeBS.dat,rspb.merged,predict.to,month,site)
source("scripts/helpers.R")
source("scripts/species_list.R")
#View(Species)
spp <- "common scoter"
#month <- "01"
month <- "03"
#survey.date <- "2020-01-19"
survey.date <- "2020-03-08"
# Load data ------------------------------------------------------------
data.loaded <- load_month_data(month,spp)
# Create a mesh (fishnet) -------------------------------------------------
MESH <- create.mesh(mask = mask,
MaxEdge = 4,
track=data.loaded$track,
obs.model = data.loaded$obs.model)
# Prepare the model -------------------------------------------------------
model.data <- model.prep(obj.list = data.loaded,
jitter.points = TRUE,
MESH = MESH,
priorrange = c(15,0.5),
priorsigma = c(1,0.5))
# Run the spde model ------------------------------------------------------
lgcp.model <- lgcp.spde(modprep.list = model.data)
# Create model predictions in space ---------------------------------------
predictions <- model.predictions(MESH = MESH,lgcp.fit = lgcp.model)
# Save the predictions to the output folder
save.predictions(predicted=predictions$predicted,month = month,spp=spp)
##
#prediction.raster <- readRDS("outputs/Common scoter_month01.rds")
# Plot the predicted distribution -----------------------------------------
plot.abundance(predicted=predictions$predicted,track=data.loaded$track,
plot.title = "Density of Common Scoter (January 2020)",
plot.boundary = T,plot.coastline = T,round.scale = 0)
# Plot population estimate ------------------------------------------------
plot.pop.priors(pred.list = predictions)
# Get population estimate numerically -------------------------------------
predictions$marginals
spp <- "common scoter"
month <- "01"
#month <- "03"
survey.date <- "2020-01-19"
load_VP_data()
locs.iww <- subset_IWW_date(survey.date = survey.date)
locs.sea <- calculate.buffer(locs.iww = locs.iww,
mask = mask,
buffer.size=2)
iww$taxonName <- plyr::revalue(iww$taxonName, c("Common eider"="Eider"))
merge.iww_to_WeBS_polys(iww = iww,
locs.sea = locs.sea,
polygs = polygs)
plot.basic.view(locs.sea = locs.sea,
mask = mask,
locs.iww = locs.iww,
polygs.iww = polygs.iww)
counts <- subset_species(iww.locs = iww.locs,spp = spp)
outputs <- create.polygons(locs.sea,
iww.aggr,
counts,
save.output = T,
spp = spp,
survey.date = survey.date)
source("scripts/helpers.R")
load_VP_data()
locs.iww <- subset_IWW_date(survey.date = survey.date)
locs.sea <- calculate.buffer(locs.iww = locs.iww,
mask = mask,
buffer.size=2)
iww$taxonName <- plyr::revalue(iww$taxonName, c("Common eider"="Eider"))
merge.iww_to_WeBS_polys(iww = iww,
locs.sea = locs.sea,
polygs = polygs)
plot.basic.view(locs.sea = locs.sea,
mask = mask,
locs.iww = locs.iww,
polygs.iww = polygs.iww)
counts <- subset_species(iww.locs = iww.locs,spp = spp)
outputs <- create.polygons(locs.sea,
iww.aggr,
counts,
save.output = T,
spp = spp,
survey.date = survey.date)
plot(outputs$polygs.dens)
outputs$polygs.dens@data
outputs$locs.dens@data
polygs
polygs@data
source('D:/PROJECTS_CURRENT/SNH_Moray_Firth/SNH_Moray_Firth/scripts/helpers.R')
Webspolys<- readOGR(dsn = "Data/Shapefile", layer = "Banff_to_Helmsdale_WeBS")
Webspolys<-spTransform(Webspolys, UTM30)
WeBS.data <- readRDS("Data/WeBS/WeBS_wrangled_20May2020.rds")
unique(Webspolys$NAME)
unique(WeBS.data$SECTOR_NAME)
tt <- merge.data.frame(Webspolys@data,WeBS.data,by.x="NAME",by.y = "SECTOR_NAME",all.x=T)
tt
tt <- merge.data.frame(Webspolys@data,WeBS.data,by.x="NAME",by.y = "SECTOR_NAME")
tt
View(tt)
spp <- "common scoter"
tt <- tt %>%
unnest(data) %>%
dplyr::filter(tolower(SPECIES) == tolower(spp),
YEAR == 2020, MONTH == "01")
tt
names(Webspolys@data)
ts <- merge.data.frame(tt,Webspolys@data,by="NAME",all.y=T)
ts
Webspolys@data$BIRD_COUNT <- ts$BIRD_COUNT
Webspolys@data$BIRD_DENSITY <- ts$BIRD_DENSITY
month <- "01"
extracted <- raster::extract(hd.raster,Webspolys)
input.name <- paste0("outputs/",spp,"_month",month,".rds")
hd.raster <<- readRDS(input.name)
extracted <- raster::extract(hd.raster,Webspolys)
dfout <- data.frame(hd.data=unlist(lapply(extracted,function(x) mean(x,na.rm=T))),
WeBS.count=Webspolys@data$BIRD_COUNT,
WeBS.dens=Webspolys@data$BIRD_DENSITY)
dfout
source('D:/PROJECTS_CURRENT/SNH_Moray_Firth/SNH_Moray_Firth/scripts/helpers.R')
spp <- "common scoter"
month <- "01"
Webspolys<- readOGR(dsn = "Data/Shapefile", layer = "Banff_to_Helmsdale_WeBS")
Webspolys<-spTransform(Webspolys, UTM30)
#polygs$NAME<- plyr::revalue(polygs$NAME, c("Lentran"="Beauly Firth","Lentran to Bunchrew"="Beauly Firth", "Beauly Firth North"="Beauly Firth",
# "South Kessock"="Beauly Firth", "Ness Mouth"="Beauly Firth"))
#polygs<<- aggregate(polygs, by= "NAME", dissolve=T)
WeBS.data <- readRDS("Data/WeBS/WeBS_wrangled_20May2020.rds")
tt <- merge.data.frame(Webspolys@data,WeBS.data,by.x="NAME",by.y = "SECTOR_NAME")
tt <- tt %>%
unnest(data) %>%
dplyr::filter(tolower(SPECIES) == tolower(spp),
YEAR == 2020, MONTH == "01")
ts <- merge.data.frame(tt,Webspolys@data,by="NAME",all.y=T)
Webspolys@data$BIRD_COUNT <- ts$BIRD_COUNT
Webspolys@data$BIRD_DENSITY <- ts$BIRD_DENSITY
input.name <- paste0("outputs/",spp,"_month",month,".rds")
hd.raster <<- readRDS(input.name)
extracted <- raster::extract(hd.raster,Webspolys)
extracted
dfout <- data.frame(hd.data=unlist(lapply(extracted,function(x) mean(x,na.rm=T))),
WeBS.count=Webspolys@data$BIRD_COUNT,
WeBS.dens=Webspolys@data$BIRD_DENSITY)
dfout
projection(hd.raster)
View(Webspolys@data)
tt
datf <- data.frame(Test1 <- c(1,2,3),)
source("scripts/helpers.R")
source("scripts/species_list.R")
#View(Species) ## View this if you need to
spp <- "common scoter"
month <- "01"
#month <- "03"
survey.date <- "2020-01-19"
## Set the title of the output plot here
plot.title = "Common scoter IWW counts (January 2020)"
## This command loads the VP data into the environment
load_VP_data()
## Subsets the IWW data by the survey date above
locs.iww <- subset_IWW_date(survey.date = survey.date)
locs.sea <- calculate.buffer(locs.iww = locs.iww,
mask = mask,
buffer.size=2)
#Match up any differing species names in HiDef/IWW data
iww$taxonName <- plyr::revalue(iww$taxonName, c("Common eider"="Eider"))
merge.iww_to_WeBS_polys(iww = iww,
locs.sea = locs.sea,
polygs = polygs)
## displays a simple plot (optional)
plot.basic.view(locs.sea = locs.sea,
mask = mask,
locs.iww = locs.iww,
polygs.iww = polygs.iww)
## Subset species and get mean counts for selected locations (i.e. for when adjacent areas are merged)
counts <- subset_species(iww.locs = iww.locs,spp = spp)
outputs <- create.polygons(locs.sea,
iww.aggr,
counts,
save.output = F,
spp = spp,
survey.date = survey.date)
### This will load up the HiDef modelled data that was saved using the
### save.predictions function
load.rasters(spp,survey.date,month)
## Vantage point polygons were converted to rasters in the create.polygons function
## we can compare those rasters at face value (grid cell to grid cell)
valuesout <- compare.rasters(hd.raster,outputs$buffer_ras,log.scale=T)
psout <- compare.polygons(pgons = outputs$locs.dens,
hd.raster,
log.scale = T)
psout <- compare.polygons(pgons = outputs$locs.dens,
hd.raster,
log.scale = F)
## Compare the polygons to the HD raster using the compare polygons function
subsetcompare <- compare.polygons(pgons = pgonsout,
hd.raster = hd.raster,
log.scale = T)
### This creates a nice looking plot of the buffers
plot.iww.pgons(pgons=outputs$locs.dens,track=data.loaded$track,
plot.title=plot.title)
load(file = 'Data/Shapefile/UK_coastline.rda')
dataf <- tbl_df(finger=c(1,2,3,4,5))
dataf <- tbl_df(data.frame(finger=c(1,2,3,4,5)))
dataf <- data.frame(finger=c(1,2,3,4,5))
hand <- data.frame(finger=c(1,2,3,4,5))
dplyr::select(hand,finger==3)
dplyr::filter(hand,finger==3)
hand <- data.frame(finger=c(1,2,3,4,5))
dplyr::filter(hand,finger==3)
hand <- data.frame(
finger=1:5
)
hand
hand[hand$finger==3]
hand[hand$finger==3,]
source("scripts/helpers.R")
source("scripts/species_list.R")
#View(Species) ## View this if you need to
spp <- "common scoter"
month <- "01"
#month <- "03"
survey.date <- "2020-01-19"
#survey.date <- "2020-03-08"
## Set the title of the output plot here
plot.title = "Common scoter IWW counts (January 2020)"
# Wrangling the IWW data --------------------------------------------------
data.loaded <- load_month_data(month,spp)
## This command loads the VP data into the environment
load_VP_data()
## Subsets the IWW data by the survey date above
locs.iww <- subset_IWW_date(survey.date = survey.date)
## Creates the buffer around the VPs for comparing against HD data
## This is set to 2 (km) at the minute - see buffer.size=2
## But could be changed to something else
## We are recommending this stay at 2km as it's the maximum distance at which
## birds can be reliably identified.
locs.sea <- calculate.buffer(locs.iww = locs.iww,
mask = mask,
buffer.size=2)
## Merges IWW vantage points with the WeBS polygon for a naming convention.
#Match up any differing species names in HiDef/IWW data
iww$taxonName <- plyr::revalue(iww$taxonName, c("Common eider"="Eider"))
merge.iww_to_WeBS_polys(iww = iww,
locs.sea = locs.sea,
polygs = polygs)
## displays a simple plot (optional)
plot.basic.view(locs.sea = locs.sea,
mask = mask,
locs.iww = locs.iww,
polygs.iww = polygs.iww)
## Subset species and get mean counts for selected locations (i.e. for when adjacent areas are merged)
counts <- subset_species(iww.locs = iww.locs,spp = spp)
## This outputs a list of the vantage point polygons (locs.dens),
## the WeBS polygons (polygs.dens), and a raster representation
## of the buffers.
outputs <- create.polygons(locs.sea,
iww.aggr,
counts,
save.output = F,
spp = spp,
survey.date = survey.date)
### This will load up the HiDef modelled data that was saved using the
### save.predictions function
load.rasters(spp,survey.date,month)
# Comparing hidef raster to vantage point raster --------------------------
## Vantage point polygons were converted to rasters in the create.polygons function
## we can compare those rasters at face value (grid cell to grid cell)
valuesout <- compare.rasters(hd.raster,outputs$buffer_ras,log.scale=F)
# Comparing Hidef raster to vantage point polygons ------------------------
## Using this function we can look at the mean density of birds/hr in the
## IWW polygons (2km buffers) and compare against the mean of the HiDef
## modelled output. outputs$locs.dens is the polygon shapefile for IWW
psout <- compare.polygons(pgons = outputs$locs.dens,
hd.raster,
log.scale = F)
### This creates a nice looking plot of the buffers
plot.iww.pgons(pgons=outputs$locs.dens,track=data.loaded$track,
plot.title=plot.title)
plot(outputs$locs.dens)
source("scripts/helpers.R")
source("scripts/species_list.R")
#View(Species) ## View this if you need to
spp <- "common scoter"
#month <- "01"
month <- "03"
#survey.date <- "2020-01-19"
survey.date <- "2020-03-08"
## Set the title of the output plot here
plot.title = "Common scoter IWW counts (January 2020)"
# Wrangling the IWW data --------------------------------------------------
data.loaded <- load_month_data(month,spp)
## This command loads the VP data into the environment
load_VP_data()
## Subsets the IWW data by the survey date above
locs.iww <- subset_IWW_date(survey.date = survey.date)
## Creates the buffer around the VPs for comparing against HD data
## This is set to 2 (km) at the minute - see buffer.size=2
## But could be changed to something else
## We are recommending this stay at 2km as it's the maximum distance at which
## birds can be reliably identified.
locs.sea <- calculate.buffer(locs.iww = locs.iww,
mask = mask,
buffer.size=2)
## Merges IWW vantage points with the WeBS polygon for a naming convention.
#Match up any differing species names in HiDef/IWW data
iww$taxonName <- plyr::revalue(iww$taxonName, c("Common eider"="Eider"))
merge.iww_to_WeBS_polys(iww = iww,
locs.sea = locs.sea,
polygs = polygs)
## displays a simple plot (optional)
plot.basic.view(locs.sea = locs.sea,
mask = mask,
locs.iww = locs.iww,
polygs.iww = polygs.iww)
## Subset species and get mean counts for selected locations (i.e. for when adjacent areas are merged)
counts <- subset_species(iww.locs = iww.locs,spp = spp)
## This outputs a list of the vantage point polygons (locs.dens),
## the WeBS polygons (polygs.dens), and a raster representation
## of the buffers.
outputs <- create.polygons(locs.sea,
iww.aggr,
counts,
save.output = F,
spp = spp,
survey.date = survey.date)
plot(outputs$locs.dens)
raster::shapefile() outputs$locs.dens)
help("shapefile")
raster::shapefile(outputs$locs.dens,filename="outputs/IWW_vantage_points_March")
source("scripts/helpers.R")
source("scripts/species_list.R")
RSPBfiles <- list.files("Data/RSPB_data_filtered/",full.names = TRUE)
spp <- "red-throated diver"
rspb.data <- wrangle.RSPB.data(spp,save.output=T)
rspb.m <- merge.RSPB.to.WeBS(spp,rspb.data)
rspb.merged <- rspb.m$merged
WeBS.dat <- rspb.m$WeBS
rspb.v.webs.jan <- RSPB.v.WeBS.plot("JAN",rspb.merged)
rspb.v.webs.dec <- RSPB.v.WeBS.plot("DEC",rspb.merged)
## Run these to explore plots
rspb.v.webs.dec
rspb.v.webs.jan