rankPlots: rankPlots

Description Usage Arguments Details Value See Also Examples

View source: R/rankPlots.R

Description

helps fix spelling mistakes in the labels of a set of samples.

Usage

1
2
3
4
5
6
7
8
rankPlots(
  x,
  y,
  z,
  min.size = 1,
  priority = c("diversity", "richness", "patch_count", "pixel_frequency",
    "road_distance")
)

Arguments

x

Object of class RasterLayer, RasterStack or RasterBrick.

y

Object of class SpatialPolygons or SpatialPolygonsDataFrame.

z

Object of class SpatialLines or SpatialLinesDataFrame.

min.size

Numeric element.

priority

Character vector.

Details

For each polygon in y, the function will determine the distance between its centroid and the nearest road provided through z, count the number of classes in x and the number of patches of connected pixels and report on the proportion of non NA values. The patch count can be restricted to those with a size greater min.size which specifies the minimum number of pixels per patch. Then, the function will use this data to rank the elements of y according to the order of the keywords in priority. The user can choose one or more of the following keywords:

The final output is a data.frame reporting on:

Value

A list.

See Also

derivePlots ccLabel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{

require(raster)
require(RStoolbox)
require(ggplot2)

# read raster data
r <- brick(system.file("extdata", "ndvi.tif", package="fieldRS"))

# read road information
data(roads)

# unsupervised classification with kmeans
uc <- unsuperClass(r, nSamples=5000, nClasses=5)$map

# derive potential sampling plots
pp <- derivePlots(uc, 1000)

# plot ranking
pp@data <- rankPlots(uc, pp, roads)

# plot output
gp <- fortify(pp, region="ranking")
ggplot(gp, aes(x=long, y=lat, group=group, fill=as.numeric(id))) + 
geom_polygon() + scale_fill_continuous(name="Ranking")

}

RRemelgado/fieldRS documentation built on June 5, 2020, 1:48 p.m.