ggspatial (version 0.2.1)

as.CRS: Extract a projection from an object

Description

Many functions in this package require projection information. This function allows a CRS to be extracted from various objects, notably Spatial*, Raster*, and integers (which are assumed to be EPSG codes). This allows for less verbose syntax when dealing with projections in this package.

Usage

as.CRS(x)

Arguments

x

An object

Value

A CRS object, or NA if one cannot be extracted

Examples

Run this code
# NOT RUN {
as.CRS(4326) # integer
as.CRS(longlake_osm) # raster
as.CRS(longlake_waterdf) # spatial

# }

Run the code above in your browser using DataLab