Learn R Programming

DWBmodelUN (version 1.0.0)

Coord_comparison: Raster coordinates comparison

Description

This function compares three characteristics from two rasters: coordinates, resolution, and number of layers (if the rasters have more than one) from two different rasters stacks, and let to know if they are using the same geographical information, or if a new set-up should be done.

Usage

Coord_comparison(r1, r2)

Arguments

r1

raster or data frame. If it is a data frame, it should contain in the first two columns, the X, Y coordinates for every point, in GEOGRAPHIC COORDINATES, the third column and so on should have the variable values, and optionally, the header should have the date, using the format %m/%Y.

r2

raster or data frame. If it is a data frame, it should contain in the first two columns, the X, Y coordinates for every point, in GEOGRAPHIC COORDINATES, the third column and so on should have the variable values, and optionally, the header should have the date, using the format %m/%Y.

Value

It prints on console whether the two rasters are on the same coordinates or not, and return a boolean, TRUE if the rasters are on the same coordinates, and FALSE if not.

Examples

Run this code
# NOT RUN {
data(P_sogamoso, PET_sogamoso)
Coord_comparison(P_sogamoso, PET_sogamoso)

# }

Run the code above in your browser using DataLab