This creates an instance of the Region class. If the user supplied a
shapefile all information will be extracted from here. Otherwise the user
needs to specify a list of polygons describing the areas of interest
(coords) and optionally a list of polygons describing the areas to
be excluded (gaps). If area is not specified it will be calculated.
the units given as a character (either 'm' or 'km')
area
the area of the region (optional - if not supplied it will be
calculated for you)
shapefile
a shapefile of the region
coords
list of polygons describing the areas of interest
gaps
list of polygons describing the areas to be excluded
Value
object of class Region
Author(s)
Laura Marshall
Examples
coords <- gaps <- list()
coords[[1]] <- list(data.frame(x = c(0,1000,1000,0,0), y = c(0,0,
1000,1000,0)))
gaps[[1]] <- list(data.frame(x = c(400,600,500,350,400), y = c(100,
250,600,120,100)))
region <- make.region(region.name = "study.area", units = "m",
coords = coords, gaps = gaps)
plot(region)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(DSsim)
Loading required package: splancs
Loading required package: sp
Spatial Point Pattern Analysis Code in S-Plus
Version 2 - Spatial and Space-Time analysis
Loading required package: mrds
This is mrds 2.1.14
Built: R 3.3.1; ; 2016-07-02 00:29:24 UTC; unix
Loading required package: mgcv
Loading required package: nlme
This is mgcv 1.8-12. For overview type 'help("mgcv-package")'.
Loading required package: shapefiles
Loading required package: foreign
Attaching package: 'shapefiles'
The following objects are masked from 'package:foreign':
read.dbf, write.dbf
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/DSsim/make.region.Rd_%03d_medium.png", width=480, height=480)
> ### Name: make.region
> ### Title: Creates a Region object
> ### Aliases: make.region
>
> ### ** Examples
>
> coords <- gaps <- list()
> coords[[1]] <- list(data.frame(x = c(0,1000,1000,0,0), y = c(0,0,
+ 1000,1000,0)))
> gaps[[1]] <- list(data.frame(x = c(400,600,500,350,400), y = c(100,
+ 250,600,120,100)))
>
> region <- make.region(region.name = "study.area", units = "m",
+ coords = coords, gaps = gaps)
> plot(region)
>
>
>
>
>
>
> dev.off()
null device
1
>