Description Usage Arguments Value See Also Examples

Standard mathematical methods for computations with SpatRaster objects. Computations are local (applied on a cell by cell basis). If multiple SpatRaster objects are used, these must have the same extent and resolution. These have been implemented:

`abs, sign, sqrt, ceiling, floor, trunc, cummax, cummin, cumprod, cumsum, log, log10, log2, log1p, acos, acosh, asin, asinh, atan, atanh, exp, expm1, cos, cosh, sin, sinh, tan, tanh, round, signif`

Instead of directly calling these methods, you can also provide their name to the `math`

method. This is useful if you want to provide an output filename.

The following methods have been implemented for `SpatExtent`

: `round, floor, ceiling`

`round`

has also been implemented for `SpatVector`

, to round the coordinates of the geometries.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ```
## S4 method for signature 'SpatRaster'
sqrt(x)
## S4 method for signature 'SpatRaster'
log(x, base=exp(1))
## S4 method for signature 'SpatRaster'
round(x, digits=0)
## S4 method for signature 'SpatRaster'
math(x, fun, digits=0, filename="", overwrite=FALSE, ...)
## S4 method for signature 'SpatVector'
round(x, digits=4)
``` |

`x` |
SpatRaster |

`base` |
a positive or complex number: the base with respect to which logarithms are computed |

`digits` |
Number of digits for rounding |

`fun` |
character. Math function name |

`filename` |
character. Output filename |

`overwrite` |
logical. If |

`...` |
additional arguments for writing files as in |

SpatRaster or SpatExtent

See `app`

to use mathematical functions not implemented by the package, and `Arith-methods`

for arithmetical operations

1 2 3 4 5 6 7 8 9 10 11 12 13 |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.