Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

intFun.grid.na

Replace NA with zero in raster object


Description

This function sets all NA's in a raster object to zero.

Usage

intFun.grid.na(x)

Arguments

x

A raster object

Value

A raster object where all NA's have been replaced with zero

Examples

library(raster)
# create a raster object with NA
data <- c(runif(99,-10,10),NA)
data <- matrix(data, ncol=10)
data <- raster::raster(data)
# replace NA with zero in raster object
data <- intFun.grid.na(data)
plot(data); text(data)

amber

Automated Model Benchmarking R Package

v1.0.3
GPL-3
Authors
Christian Seiler [cre, aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.