DOI: 10.5061/dryad.6wwpzgnb2
title: Scripts from: Remotely sensed microhabitat characteristics associated with Haematopus palliatus (American Oystercatcher) nest-site selection can inform beach habitat restoration along the U.S. Atlantic Coast

description: Shorebird populations are in steep decline and have lost almost 70% of
 their North American populations on average since 1970. The declines are
 accelerating for most species, in part because coastal environments face
 significant threats from anthropogenic activities, leading to habitat loss
 or degradation. Haematopus palliatus (American Oystercatchers) have begun
 to recolonize areas in their northern breeding range where they were
 previously extirpated; however, threats persist due to habitat loss, human
 disturbances, and high predation risk. Coastal habitat restoration,
 particularly the use of dredged material to enhance beach habitats, has
 been shown to be a viable conservation strategy. To inform restoration
 design, this study aims to quantify the microhabitat characteristics
 influencing H. palliatus nest-site selection across sandy beaches along
 the U.S. Atlantic coast, utilizing high-resolution lidar data. We analyzed
 1,349 nest locations compiled from targeted surveys, comparing them to
 randomly generated pseudo-absence points. We calculated 17
 geomorphological variables representing microhabitat from public domain,
 lidar-based digital elevation models and employed boosted regression trees
 to model their relationship to nest presence. Results indicated that nest
 elevation, distance to mean sea level and mean high water, and shoreline
 sinuosity were the most important predictors of nest presence, with
 differences observed between northern and southern regions. In the
 northern states from New Jersey to Connecticut, low shoreline sinuosity
 was most important, likely due to its role in reducing predation risk,
 whereas in the southern states from Virginia to Florida, nest elevation
 emerged as the dominant factor, suggesting a regional adaptation to the
 more rapid increases in sea level rise along the southern Atlantic coast.
 These findings highlight the importance of microhabitat characteristics in
 the design, restoration, and management of shorebird nesting habitats, and
 can contribute to best practices for conservation efforts aimed at
 sustaining H. palliatus populations amidst escalating coastal threats.
description: # Scripts from: Remotely sensed microhabitat characteristics associated
 with Haematopus palliatus (American Oystercatcher) nest-site selection can
 inform beach habitat restoration along the U.S. Atlantic Coast Dataset
 DOI: [10.5061/dryad.6wwpzgnb2](10.5061/dryad.6wwpzgnb2) ## Description of
 the data and file structure **Summary** This directory contains the
 scripts used in the Ornithological Applications publication titled
 *Remotely sensed microhabitat characteristics associated with Haematopus
 palliatus (American Oystercatcher) nest-site selection can inform beach
 habitat restoration along the U.S. Atlantic Coast* (Grand et al. In
 Press). The nest location data associated with this publication are owned
 by multiple institutions/agencies and require permission to use;
 therefore, the dataset is not included here. All data owners are listed in
 the acknowledgements section of the journal article. ### Files and
 variables #### File: ORNITH-APP-25-026.zip Nest coordinates used in the
 analysis require permission from the data owners; however, the scripts
 provided can be applied to any set of nest coordinates and random points. 
 ## Code/software **Python scripts for calculating nest and random point
 covariates** 1\)       Covariates_tidal_and_elevation_1.py: Run this
 script for each site (uncomment one site at a time) 2\)      
 Covariates_landform_2.py: Run this script for each site. 3\)      
 Covariates_combine_site_results_3.py: This script should be run just once,
 after all site-specific calculations are complete. Please refer to
 additional data preparation instructions at the beginning of each script.
 **R scripts for Running Boosted Regression Trees** 1\)      
 BRT_functions.R: These functions iteratively determine learning rate, bag
 fraction, and tree complexity and select the best full model while
 ensuring the model was built with &gt;1000 trees. The file also contains a
 function that generates the variable importance plots. 2\)      
 BRT_script_AMOY_1.R: This script cleans up the input file, adds
 latitudinal and longitudinal folds for spatial cross validation, checks
 for correlations among covariates and for covariates with no variation,
 and calls the functions in BRT_functions.R to model presence/absence of
 AMOY nests. 3\)       BRT_script_AMOY_2.R: This script summarizes variable
 importance, deviance explained, cross-validated AUC, TSS, and Moran’s I.
 It also produces draft response plots using built in functions. 4\)      
 BRT_script_AMOY_3.R: The script produces customized response plots more
 suitable for publication than the built in function.