Supplement 1. R code for simulating treatment effects on local survival and models fitted with the R package unmarked.

<h2>File List</h2><p> <a href="BACIocc.r">BACIocc.r</a> (md5: 77df2f2d3edc106acaaaa8d8e55c4ee9)<br> <a href="dynamicOcc.r">dynamicOcc.r</a> (md5: f3da3d532685597b12a8469ae9bb1ade) </p><h2>Description</h2><p> BACIocc.r and dynamicOcc.r contain R code used to simulate treatment effects on local survival, and models fitted with the R package unmarked 0.9-2 (Fiske and Chandler 2011). BACIocc.r contains code for simulating occupancy data (detection/non-detection) using a Before-After Control-Impact framework, and dynamicOcc.r contains code for dynamic occupancy model fitting. dynamicOcc.r cannot be run independently, but only in conjunction with BACIocc.r, where all variables are declared initialized. Variable definitions and other detailed explanations are embedded in the R code. </p>