knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of rproj is to provide a literal wrapper around the PROJ C API. It uses libproj as a standalone copy of PROJ independent of a system installation.
You can install the development version from R Universe with:
install.packages("rproj", repos = "https://paleolimbot.r-universe.dev")
Create a transform and transform some coordinates:
library(rproj) pipe <- proj_create_crs_to_crs("OGC:CRS84", "EPSG:3827") proj_trans(pipe, proj_coord(-64, 45))
You can transform arbitrary R objects using the crs2crs interface:
library(crs2crs) crs_set_engine(crs_engine_rproj()) library(sf) nc <- read_sf(system.file("shape/nc.shp", package = "sf")) nc %>% crs_set_longlat(datum = "NAD27") %>% crs_transform("EPSG:3857")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.