stratified.GUI: Graphic User Interface (GUI) for selection of stratified GRTS...

Description Usage Details Value Required Inputs Optional Inputs Dialog Buttons Author(s) References See Also Examples

Description

Initiates a dialog box via a GUI to select stratified samples from 2-D resources.

Usage

1

Details

This routine is intended to be called from the SDrawNPS menu, but it can also be called from the command line in non-interactive environments, such as RStudio. This routine uses the RGtk2 package windowing capabilities to construct a pop-up dialog box, or GUI. In the dialog box, users specify at least the required input parameters, then press the ‘Run’ button to draw the sample.

On submission, the GUI internally packages its inputs, processes the necessary shapefile, and executes the spsurvey-package grts function. All SDrawNPS GUI submissions utilizing the GRTS sampling methodology lead to the creation of a text-based log file, which records all code utilized. The log file thus serves as a historical record containing sampling information, including the random seed utilized. It also serves as a tool for enhancing methodological understanding.

See ‘References’ for additional resources.

Value

A SpatialDesign (see the spsurvey package) object with the name specified by the user in the GUI's Sample's R name box. This object contains the sampling design specifications, the selected sample points in GRTS order, coordinates, and projection information. Sample objects are stored in the current workspace, while any export files, including a txt log of the commands utilized to generate the sample, are saved to the file directory specified via getwd.

Any maps drawn during the sampling process must be saved before R is closed. See dev.copy, jpg, and other graphics device functions.

Required Inputs

Optional Inputs

  1. The ‘Random number seed.’ When specified, the seed may be used to recreate the sample. When not specified, i.e., the box is left blank, a random seed is selected against the current time. See set.seed. In both cases, the seed ultimately utilized is recorded in both the resulting log text file and R Console. Recording the seed allows for the easy redrawing of samples if lost, or if more sites are needed. Any integer value is acceptable as the random number seed.

  2. The number of oversample points, as encompassed via the ‘Over sample, each strata’ box, can be specified within each stratum. Oversample points are listed after the main sample points in the GRTS design file, i.e., the resulting sample R output object. They can also be identified in the ‘panel’ variable of the sample output. Apply caution when specifying oversample points, as large oversamples can cause samples to tend toward a proportional-to-size allocation even when other allocations are specified.

Dialog Buttons

  1. ‘Inspect Frame.’ After specifying the shapefile or sp object name, pressing the ‘Inspect Frame’ button plots the shapefile. It also lists the variables and their class in the shapefile's attribute data. After drawing a sample, the ‘Inspect Frame’ button plots the study area, along with sampled points.

  2. ‘Run.’ After specifying all required and optional inputs, the ‘Run’ button draws the sample. The .GlobalEnv workspace holds the resulting SpatialDesign object with the name specified via the GUI Sample's R name box. A confirmation dialog appears following completion of the draw. Large samples may require several tens of minutes for completion.

  3. ‘Plot Sample.’ Following sampling, the ‘Plot Sample’ button displays the sampled points on the sampling frame.

  4. ‘Tabulate Sample.’ Following sampling, display the GRTS design file in a tabular format. The GRTS design file contains information on each sampled unit, such as coordinates, and design variables, e.g., stratum or multi-density category. It also contains design weights.

  5. ‘Export.’ Following sampling, the ‘Export’ button prompts the user to save sampling results via a pop-up dialog box. The sample can be exported as an ArcGIS shapefile (.SHP); Comma Separated (.CSV); Google Earth (.KML); or Garmin format (.GPX) file.

    Shapefiles actually consist of several files with different extensions. Because of this, do not include the .SHP extension in the Name field of the pop-up when exporting to a shapefile.

  6. ‘Done.’ Dismisses the GUI dialog box, leaving any sample objects in the .GlobalEnv workspace.

Author(s)

Trent McDonald (tmcdonald@west-inc.com) and Jason Mitchell (jmitchell@west-inc.com)

References

Stevens, D. L. and A. R. Olsen (2004). Spatially balanced sampling of natural resources. Journal of the American Statistical Association 99, 262-278.

Kincaid, T. (2015). GRTS Survey Designs for an Area Resource. Accessed online May 6, 2016. https://cran.r-project.org/web/packages/spsurvey/vignettes/Area_Design.pdf.

Starcevich L. A., DiDonato G., McDonald T., Mitchell, J. (2016). A GRTS User's Manual for the SDrawNPS Package: A graphical user interface for Generalized Random Tessellation Stratified (GRTS) sampling and estimation. National Park Service, U.S. Department of the Interior. Natural Resource Report NPS/XXXX/NRR—20XX/XXX.

See Also

spsurvey::grts

Examples

1
2
3
# Open a GUI for stratified GRTS sampling.
stratified.GUI()
    

tmcd82070/SDrawNPS documentation built on May 31, 2019, 4:37 p.m.