resamplearray: resamplearray: resamples an array to the dimensions of...

Description Usage Arguments Value Examples

Description

reformats data in an array and creates a new array objects to dimensions specified by rin.

Usage

1
resamplearray(a, rin, rout)

Arguments

a

the array object to be resampled.

rin

a raster object used to resample extent of 'a' to extent of 'rout'.

rout

a raster object with extent parameters that 'a' should be resampled to.

Value

an array with the same latitude and longitude as 'rout'.

Examples

1
2
3
4
5
6
7
8
9
originalarray <- array(rnorm(100), dim=c(94,192,1464))
rin <- raster(originalarray[,,1])
extent(rin) <- c(-0.9375, 359.0625, -89.49406, 89.49406)
routm <- matrix(rnorm(10512), 73, 144)
rout <- raster(routm)
extent(rout) <- c(-1.25, 358.75, -91.25, 91.25)
newarray <- resamplearray(a, rin, rout)
dim(originalarray)
dim(newarray)

ilyamaclean/climvars documentation built on June 19, 2019, 2:22 p.m.