Transform coordinates via 'PROJ' using the library directly, by wrapping the 'proj4' package. The 'reproj' function handles the need for radian units for either source or target and allows removing an explicit source definition in methods that extend the generic. The 'PROJ' library is available at < https://proj4.org/>.
The goal of reproj is to reproject data between coordinate systems.
There are a number of limitations to the proj4 package that is used by reproj, please use reproj at your own risk. The sf package provides a better supported facility to modern code and for datum transformations. We have not even checked if proj4 can do that. If a more generic interface to the PROJ library becomes available we will configure reproj to use it.
You can install the dev version of reproj from github with:
This example shows how to convert between coordinate systems:
library(reproj)reproj(cbind(c(147, 148), c(-42, -45)), target = "+proj=laea +datum=WGS84", source = 4326)#> [,1] [,2] [,3]#> [1,] 5969744 -9803200 0#> [2,] 5362760 -10052226 0
Please note that the ‘reproj’ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.