seq_sites: Sequential coastal site order

View source: R/seq_sites.R

seq_sitesR Documentation

Sequential coastal site order

Description

This function finds the order of sites along a convoluted but contiguous coastline. It is not designed to work for multiple different coastlines at once.

Usage

seq_sites(site_list, reverse = FALSE, coast = TRUE)

Arguments

site_list

A dataframe with a 'lon' and 'lat' column that contains coordinates along a coastline that need to be ordered.

reverse

A boolean TRUE/FALSE to determine if the ordering of the sites should be reversed on output. Default = FALSE.

coast

Should only the coastline be used to calculate the sequence of sites? Or should islands be included? Note that sites located on islands will have their sequence of order calculated after sites along the coast. This is generally not a desired outcome. Default = TRUE.

Value

A dataframe with the correct ordering of the input sites

Examples

SACTN_site_list_sub <- SACTN_site_list[17:32,]
SACTN_site_list_ordered <- seq_sites(SACTN_site_list_sub)

schrob040/coastR documentation built on June 10, 2025, 5:25 p.m.