findSeedPlots: Finding All Possible Seedling Plots In An Area

Description Usage Arguments Value Note Examples

Description

This function searches a dataframe of seedlings and returns a list of (x,y) coordinates where they are clumped together. The individuals entered into this function must be of the same species, and the data.frame must contain an "x" column, a "y" column, and a "treeid" column. The former two must be numeric or integers.

Usage

1
findSeedPlots(seedlings, m)

Arguments

seedlings

This is a data.frame with "x", "y", and "treeid" columns, representing individual seedlings' geographic location and a unique identifier.

m

This is the search radius to search around each seedling to find its neighbors. The search parameter is a square, not a circle.

Value

This function returns a response data.frame with columns "x" and "y" to represent geographic location of the center of the box, and "n" with a number of seedlings found in that box.

Note

This function follows these steps: Starting with the first row, it determines an m-bounded box around the (x,y) coordinates given. All individuals in the box (via a subset of the seedlings data.frame) are counted, and then removed from future searches to prevent double-counts. This algorithm may find slightly different results depending on the order of the seedlings in your data.frame. Plan accordingly. This function does not minimize the number of boxes drawn.

Examples

1
2
3
4
5
6
7
## make a sample seed data.frame by subsetting the included
## expandedTrees data.frame..
sampleseeds <- expandedTrees[expandedTrees$plot=="trinity" &
                             expandedTrees$measyear==2001 &
                             expandedTrees$stage=="seedling",]
## show the start of results
head(findSeedPlots(sampleseeds, 1))

ecology-rocks/disperseR documentation built on May 15, 2019, 7:58 p.m.