Learn R Programming

terra (version 1.7-83)

transpose: Transpose

Description

Transpose a SpatRaster or SpatVector

Usage

# S4 method for SpatRaster
t(x)

# S4 method for SpatVector t(x)

# S4 method for SpatRaster trans(x, filename="", ...)

Value

SpatRaster

Arguments

x

SpatRaster or SpatVector

filename

character. Output filename

...

additional arguments for writing files as in writeRaster

See Also

flip, rotate

Examples

Run this code
r <- rast(nrows=18, ncols=36)
values(r) <- 1:ncell(r)
tr1 <- t(r)
tr2 <- trans(r)
ttr <- trans(tr2)

Run the code above in your browser using DataLab