RSamplePlots: Random sample elements in a cartesian arena

Description Usage Arguments Value Details Examples

Description

Draw a sample from data with elements in a cartesian coordinate system

Usage

1
2
3
RSamplePlots(plotdata, nsamples, dimx = NULL, dimy = NULL, xname = "gx",
  yname = "gy", shape = c("rectangle", "circle"), size = c(5, 5),
  distance = 0, showplots = FALSE, maxiter = 10^5)

Arguments

plotdata

a data frame with a forest plot census data.

nsamples

numeric value. The number of sample units.

dimx

numeric vector with two positions minimum and maximum value of the x coordinate.

dimy

numeric vector with two positions minimum maximum value of the y coordinate.

xname

character string with the name of the x coordinate variable.

yname

character string with the name of the y coordinate variable.

shape

a character string. Two shapes are possible: "rectangle" and "circle"

size

numeric vector. For ”rectangle” the dimension of x and y sidesand for ”circle” the radius size.

distance

numeric value. The minimum distance among plots

showplots

Boolean. True if plot should be plotted in a graph.

maxiter

numeric value. indicating the maximum number of trails to sample units without overlaping.

Value

a data frame with the same columns as plotdata plus a 'sample' representing the sample unit number that the element are in.

Details

Draw sample from elements in a cartesian coordinate system and return the subset of data in the sample.

Examples

1
2
3
4
5
## Not run: 
data(bci7)
plotData <- RSamplePlots(bci7, nsamples = 100, shape = "circle", size = 10)

## End(Not run)

vitorpaciello/Rsampleplot documentation built on May 15, 2019, 3:21 p.m.