changeproj,prevR-method | R Documentation |
This function converts map projection (and/or datum) used by an object of class prevR into another one.
## S4 method for signature 'prevR'
changeproj(object, proj)
object |
object of class prevR. |
proj |
new map projection. One of
(i) character: a string accepted by GDAL, (ii) integer, a valid EPSG value
(numeric), or (iii) an object of class |
changeproj()
transform the columns "x" and "y" of the slot
clusters
of object
and convert boundary
using the new
map projection defined by proj
.
If applicable, the slot rings
will be recalculated.
Return object
expressed in the projection proj
.
sf::st_transform()
, prevR
print(fdhs)
plot(fdhs, axes = TRUE, main = "Projection: longitude/latitude")
fdhs2 <- changeproj(
fdhs,
"+proj=utm +zone=30 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"
)
print(fdhs2)
plot(fdhs2, axes = TRUE, main = "Projection: UTM Zone 30")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.