Replace NA
values on layers/attributes with specified values
Usage
# S3 method for class 'SpatRaster'
replace_na(data, replace = list(), ...)
# S3 method for class 'SpatVector'
replace_na(data, replace, ...)
Arguments
- data
A
SpatRaster
created withterra::rast()
or aSpatVector
created withterra::vect()
.- replace
list of values, with one value for each layer/attribute that has
NA
values to be replaced.- ...
Ignored
terra equivalent
Use r[is.na(r)] <- <replacement>
See also
Other tidyr verbs for handling missing values:
drop_na.Spat
,
fill.SpatVector()
Other tidyr methods:
drop_na.Spat
,
fill.SpatVector()
,
pivot_longer.SpatVector()
,
pivot_wider.SpatVector()