get_small_tiles: Identify small partitions that need to be fixed.

Description Usage Arguments Value See Also Examples

View source: R/sperrorest_misc.R

Description

get_small_tiles identifies partitions (tiles) that are too small according to some defined criterion / criteria (minimum number of samples in tile and/or minimum fraction of entire dataset).

Usage

1
get_small_tiles(tile, min_n = NULL, min_frac = 0, ignore = c())

Arguments

tile

factor: tile/partition names for all samples; names must be coercible to class tilename, i.e. of the form 'X4:Y2' etc.

min_n

integer (optional): minimum number of samples per partition_

min_frac

numeric >0, <1: minimum relative size of partition as percentage of sample.

ignore

character vector: names of tiles to be ignored, i.e. to be retained even if the inclusion criteria are not met.

Value

character vector: names of tiles that are considered 'small' according to these criteria

See Also

partition_tiles, tilename

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(ecuador) # Muenchow et al. (2012), see ?ecuador
# Rectangular partitioning without removal of small tiles:
parti <- partition_tiles(ecuador, nsplit = c(10,10), reassign = FALSE)
summary(parti)
length(parti[[1]])
# Same in factor format for the application of get_small_tiles:
parti_fac <- partition_tiles(ecuador, nsplit = c(10, 10), reassign = FALSE,
                             return_factor = TRUE)
get_small_tiles(parti_fac[[1]], min_n = 20) # tiles with less than 20 samples
parti2 <- partition_tiles(ecuador, nsplit = c(10, 10), reassign = TRUE,
                          min_n = 20, min_frac = 0)
length(parti2[[1]]) # < length(parti[[1]])

sperrorest documentation built on April 1, 2018, 12:27 p.m.