Instantly share code, notes, and snippets.

View trans-bs.R
bohai_sea_along_map <- plot_sites(bohai_sea_along, 1, 1, 70000)
bohai_sea_away_map <- plot_sites(bohai_sea_away, 1, 2, 70000)
grid.arrange(bohai_sea_along_map, bohai_sea_away_map, nrow = 1)
View trans-bp.R
baja_pen_along_map <- plot_sites(baja_pen_along, 1, 1, 100000)
baja_pen_away_map <- plot_sites(baja_pen_away, 1, 2, 100000)
baja_pen_island_map <- plot_sites(baja_pen_island, 1, 3, 100000)
grid.arrange(baja_pen_along_map, baja_pen_away_map, baja_pen_island_map, nrow = 1)
View trans-sa.R
south_africa_along_map <- plot_sites(south_africa_along, 1, 1, 100000)
south_africa_away_map <- plot_sites(south_africa_away, 1, 2, 100000)
south_africa_along_wide_map <- plot_sites(south_africa_along_wide, 1, 1, 100000)
south_africa_away_wide_map <- plot_sites(south_africa_away_wide, 1, 2, 100000)
grid.arrange(south_africa_along_map, south_africa_away_map,
south_africa_along_wide_map, south_africa_away_wide_map, nrow = 2)
View trans-cp.R
cape_point_along_map <- plot_sites(cape_point_along, 0.5, 1, 10000)
cape_point_away_map <- plot_sites(cape_point_away, 0.5, 2, 10000)
grid.arrange(cape_point_along_map, cape_point_away_map, nrow = 1)
View trans-func.R
# Create base map
world_map <- ggplot() +
borders(fill = "grey40", colour = "black")
# Create titles
titles <- c("Alongshore", "Shore-normal", "Islands")
# Plotting function
plot_sites <- function(site_list, buffer, title_choice, dist){
View trans-trans.R
# Cape Point, South Africa
cape_point_along <- transects(cape_point, alongshore = T)
cape_point_away <- transects(cape_point)
# South Africa
south_africa_along <- transects(south_africa, alongshore = T)
south_africa_away <- transects(south_africa)
# NB: Note here the use of the `spread` argument
south_africa_along_wide <- transects(south_africa, alongshore = T, spread = 30)
south_africa_away_wide <- transects(south_africa, spread = 30)
View trans-sample.R
# Cape Point, South Africa
cape_point <- SACTN_site_list %>%
slice(c(31, 22, 26, 17, 19, 21, 30)) %>%
mutate(order = 1:n())
# South Africa
south_africa <- SACTN_site_list %>%
slice(c(1,34, 10, 20, 50, 130, 90)) %>%
mutate(order = 1:n())
View trans-pkg.R
# devtools::install_github("robwschlegel/coastR") # Install coastR
library(coastR)
library(dplyr)
library(ggplot2)
library(gridExtra)
library(geosphere)
View seqs-bs.R
bohai_sea_map <- plot_sites(bohai_sea, 1, 1)
bohai_sea_seq_map <- plot_sites(bohai_sea_seq, 1, 2)
grid.arrange(bohai_sea_map, bohai_sea_seq_map, nrow = 1)
View seqs-bp.R
baja_pen_map <- plot_sites(baja_pen, 1, 1)
baja_pen_seq_map <- plot_sites(baja_pen_seq, 1, 2)
baja_pen_island_seq_map <- plot_sites(baja_pen_island_seq, 1, 3)
grid.arrange(baja_pen_map, baja_pen_seq_map, baja_pen_island_seq_map, nrow = 1)