% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{read_spatial}
\alias{read_spatial}
\title{Read a spatial input}
\usage{
read_spatial(x)
}
\arguments{
\item{x}{A \code{SpatRaster}, \code{SpatVector}, or file path.}
}
\value{
A \code{SpatRaster} or \code{SpatVector}.
}
\description{
Accepts an existing \code{terra} object or a file path and returns a \code{SpatRaster}
or \code{SpatVector}. Raster-like extensions are read with \code{\link[terra:rast]{terra::rast()}} and
vector-like extensions are read with \code{\link[terra:vect]{terra::vect()}}.
}
\examples{
r <- terra::rast(nrows = 2, ncols = 2, vals = 1)
read_spatial(r)
}
