Learn R Programming

GeoRange (version 0.1.0)

RandRec: Function to randomly generate points within a given rectangular shaped distribution

Description

Function to randomly generate points within a given rectangular shaped distribution

Usage

RandRec(RecShape, npts = 100)

Arguments

RecShape

- The outline of a rectangular distribution output from the EqualAreaRectangle() function

npts

- The number of randomly generated points within the rectangular shape

Value

Returns a 2-dimensional array of decimal degree coordinates within a rectangular shape

Examples

Run this code
HorseShoeTest<-PtsAlgHorseShoe(z=2000,spacing=1,endAngles=c(-90,90))
HorseShoePts<-RandHorseShoe(center=c(0,0),npts=100,HorseShoeShape=HorseShoeTest)
RecOutline<-EqualAreaRectangle(TargetArea=as.numeric(HorseShoePts$TotalArea_km2),error=0.001)
RandRec(RecShape=RecOutline,npts=100)

Run the code above in your browser using DataLab