DOI: 10.6084/m9.figshare.3559596
title: Supplement 1. R code for analysis of seed fate.

description: File List MCEM_analysis_of_seed_fate.R (MD5: f22e6f0fe39d55b7e7f0b67c45eede55) Description MCEM_analysis_of_seed_fate.R – This file contains R source code for functions to fit simultaneous estimates of survival, dispersal, and detection parameters for a single cohort of marked seeds using a Monte Carlo Expectation-Maximization algorithm. Seeds do not need to be individually identifiable, and the model assumes a single, area-constrained recovery effort. Potential users should note that the model encoded here was developed specifically for metal-tagged acorns. Survivors occur mainly in rodent caches underneath the soil surface, whereas tags from acorns that have been eaten are left on the soil surface. Tags from non-survivors are therefore assumed to be easier to locate than tags from survivors. There are 3 primary functions for users: prepare.data formats raw data for fitting, em.seedfate provides the main user interface, and continue.seedfate extends a previously completed run to obtain a more precise fit. A number of additional functions and utilities not intended to be called directly by an end user are also included. prepare.data takes the following arguments: -- TABLE: Please see in attached file. -- Data should be formatted into three data frames as follows: -- TABLE: Please see in attached file. -- -- TABLE: Please see in attached file. -- -- TABLE: Please see in attached file. -- The em.seedfate function takes the following arguments: -- TABLE: Please see in attached file. -- The continue.seedfate function takes the following arguments: -- TABLE: Please see in attached file. -- Specifying search areas: The simplest and most common topology is a circle, centered on the plot, with an inner radius r1 = 0 m and an outer radius of r2 m. This region can be encoded with a single line in search.data as shown in the first line of Table 1. Table 1. Examples of circular search region encoding -- TABLE: Please see in attached file. -- A slightly more complex circular region is a ring, coded in Table 1, sample 2. In this case, the search covers a complete circle, but the area immediately next to the plot is not searched. Another alternative is illustrated by the 4 lines in Table 1 for sample 3. Here, the search covers 4 pie-slice shaped sectors radiating from the plot at 45, 135, 225, and 315 degrees, each with an angular width of 30 degrees. The radian values for phi1 and phi2 for sample 3 correspond to 30 and 60 degrees in each of the Cartesian quadrants, and designate the angular boundaries of each subregion. Sample 4 demonstrates an alternative method to code the same search area as sample 3. Because dispersal is assumed to be isotropic and the 4 subregions are arranged radially, the integral of the dispersal kernel over sample area 3 is identical to 4 times the integral over the subregion in the first quadrant. Note that this coding shortcut may only be used if the subregions are perfectly symmetrical and dispersal is isotropic. This multiplication trick is especially useful for search areas that consist of arrays of belt transects radiating from the plot, since it allows the entire search area to be encoded using only 2 lines (Table 2, sample 5). Additional lines are required if, instead of a transect, lines of quadrats radiate from the plot (Table 2, sample 6). In both sample 5 and sample 6, transects would begin to overlap near the plot. Both designs therefore include a central circular "hub," which covers the region where overlaps are possible. Sample 7 (Table 2) does not include this hub, but the quadrats fall far enough from the plot that overlap does not occur. This design would be typical of an array of mast traps around a tree. Notice that in each of the samples listed in Table 2, the spokes and quadrats are all vertically centered on the x-axis. Table 2. Examples of hub-and-spoke search region encoding -- TABLE: Please see in attached file. -- The multiplication trick can also be used to shorten the coding for a matrix-like array of quadrats, but in this case the symmetry is based on the Cartesian quadrants. Thus, all of the quadrats in the first quadrant must be encoded. In addition, none of the encoded quadrats may cross the x- or y-axis (Table 3). Alternatively, each quadrat can be individually encoded (not shown). Table 3. Shortened encoding for quadrat arrays -- TABLE: Please see in attached file. --