-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsplit_raster_equally.Rd
39 lines (37 loc) · 1.32 KB
/
split_raster_equally.Rd
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
28
29
30
31
32
33
34
35
36
37
38
39
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/spatial_tools.R
\name{split_raster_equally}
\alias{split_raster_equally}
\title{Split a raster into equal-area parts}
\source{
The function taken and slightly modified from the `greenbrown' package (see https://rdrr.io/rforge/greenbrown/src/R/SplitRasterEqually.R). The function is defined separately in \code{\link[flapper]{flapper}} to reduce reliance on non-default packages.
}
\usage{
split_raster_equally(r, n)
}
\arguments{
\item{r}{A \code{\link[raster]{raster}}.}
\item{n}{An integer that defines the number of parts into which to split the raster.}
}
\value{
The function returns a list containing the split raster components.
}
\description{
This function splits a raster object into parts with approximately equal area.
}
\details{
The raster (\code{r}) should not only contain NAs.
}
\note{
This function requires the `plyr' package.
}
\examples{
l <- split_raster_equally(dat_gebco, 2)
l <- split_raster_equally(dat_gebco, 3)
pp <- graphics::par(mfrow = c(1, 3))
lapply(l, function(r) prettyGraphics::pretty_map(add_rasters = list(x = r)))
graphics::par(pp)
}
\references{
Forkel M, Wutzler T (2015) greenbrown -- land surface phenology and trend analysis. A package for the R software. Version 2.2, 2015-04-15, http://greenbrown.r-forge.r-project.org/.
}