Skip to contents

Reproject a raster variable to match another raster variable.

Usage

reproject(x, y, ...)

# S4 method for Cropmaps,Daymet
reproject(x, y, variablex, variabley, newvarname = variablex)

Arguments

x

S4 object. A product of interest.

y

S4 object. A product of interest.

...

extra arguments.

variablex

character. The variable of product x.

variabley

character. The variable of product y.

newvarname

character. The name of the reprojected variable.

Value

nothing. The data are saved directly in the cronus database.

Examples

if (FALSE) {
# Define required variables
region <- Region(name = "nebraska", type = "us state",
                 div = c(country = "United States", state = "Nebraska"))
date <- date_seq("2002-01-01", "2002-12-31")

## Cropmaps CDL and Daymet

# Create objects
x <- new("Cropmaps", region = region, date = date)
y <- new("Daymet", region = region, date = date)

# Reproject
reproject(x, y, variablex = "cdl", variabley = "tmin", "cdl_reprojected")
}