Learn R Programming

terra (version 1.7-83)

rep: Replicate layers

Description

Replicate layers in a SpatRaster

Usage

# S4 method for SpatRaster
rep(x, ...)

Value

SpatRaster

Arguments

x

SpatRaster

...

arguments as in rep

Examples

Run this code
s <- rast(system.file("ex/logo.tif", package="terra"))   
x <- rep(s, 2)
nlyr(x)
names(x)
x

Run the code above in your browser using DataLab