diff --git a/analysis/ais-global/05a_zonal_dist2coast_temporal.R b/analysis/ais-global/05a_zonal_dist2coast_temporal.R index 6145c3f..39962cd 100644 --- a/analysis/ais-global/05a_zonal_dist2coast_temporal.R +++ b/analysis/ais-global/05a_zonal_dist2coast_temporal.R @@ -11,7 +11,7 @@ library(parallel) library(dplyr) library(ggplot2) library(egg) - +library(raster) @@ -30,11 +30,11 @@ vars <- c("COUNT", "FISHING", "PASSENGER", "CARGO", "TANKER", "OTHER") # set dates dates_post <- c( - seq.Date(as.Date("2020-01-01"), as.Date("2020-07-01"), by = "month") + seq.Date(as.Date("2020-01-01"), as.Date("2020-06-01"), by = "month") ) %>% format("%Y%m%d") dates_pre <- c( - seq.Date(as.Date("2019-01-01"), as.Date("2019-07-01"), by = "month") + seq.Date(as.Date("2019-01-01"), as.Date("2019-06-01"), by = "month") ) %>% format("%Y%m%d") @@ -124,7 +124,7 @@ for (j in 1:length(vars)){ } -data <- rbindlist(data_list) +data <- data.table::rbindlist(data_list) #------------------------------------------------ @@ -152,7 +152,7 @@ p <- ggplot(filter(data, dcoast <= 4800), aes(x = dcoast, group = var)) + geom_hline(yintercept = 0, linetype="dotted") + geom_line(aes(y = mean), colour="#3182bd", size = 0.5) + scale_colour_brewer(palette="Set2") + - ylab(expression(Traffic~density~change~(Delta~vessels/km^2))) + xlab("Distance to coast (km)") + + ylab(expression(Traffic~density~change~(Delta~vessel~transits/km^2))) + xlab("Distance to coast (km)") + facet_wrap(var ~ ., ncol = 1) + ylim(-0.03, 0.01) + theme_article() + diff --git a/analysis/ais-global/05b_zonal_latitude_temporal.R b/analysis/ais-global/05b_zonal_latitude_temporal.R index 272aa51..59e8878 100644 --- a/analysis/ais-global/05b_zonal_latitude_temporal.R +++ b/analysis/ais-global/05b_zonal_latitude_temporal.R @@ -11,7 +11,7 @@ library(parallel) library(dplyr) library(ggplot2) library(egg) - +library(raster) # set input directory input_dir <- "data/out/ais-global/delta/" @@ -28,11 +28,11 @@ vars <- c("COUNT", "FISHING", "PASSENGER", "CARGO", "TANKER", "OTHER") # set dates dates_post <- c( - seq.Date(as.Date("2020-01-01"), as.Date("2020-07-01"), by = "month") + seq.Date(as.Date("2020-01-01"), as.Date("2020-06-01"), by = "month") ) %>% format("%Y%m%d") dates_pre <- c( - seq.Date(as.Date("2019-01-01"), as.Date("2019-07-01"), by = "month") + seq.Date(as.Date("2019-01-01"), as.Date("2019-06-01"), by = "month") ) %>% format("%Y%m%d") @@ -78,7 +78,7 @@ for (j in 1:length(vars)){ } } -data <- rbindlist(data_list) +data <- data.table::rbindlist(data_list) #------------------------------------------------ @@ -103,7 +103,7 @@ p <- ggplot(filter(data, latitude > -70 & latitude < 70), aes(x = latitude)) + # geom_hline(yintercept = 0, linetype="dotted") + geom_line(aes(y = mean), colour="#3182bd", size = 0.5) + # colour="#3182bd", scale_colour_brewer(palette = "Blues") + - ylab(expression(Traffic~density~change~(Delta~vessels/km^2))) + xlab("Latitude") + + ylab(expression(Traffic~density~change~(Delta~vessel~transits/km^2))) + xlab("Latitude") + ylim(-0.03, 0.01) + facet_wrap(var ~ ., ncol = 1) + theme_article() +