Our points represent some locale(s) on the earth (or other exoplanet) and we need to them to identify and perhaps change the projection. See the general discussion on projections for more background.
Here we will use the enigmatic Araptus attenuata data set as a raw data.frame
library(scape)
data("araptus")
araptus_sf <- st_as_sf(araptus,coords = c("Longitude","Latitude"))
araptus_sf
## Simple feature collection with 29 features and 4 fields
## geometry type: POINT
## dimension: XY
## bbox: xmin: -114.2935 ymin: 23.2855 xmax: -109.327 ymax: 29.32541
## epsg (SRID): NA
## proj4string: NA
## First 10 features:
## Site Males Females Suitability geometry
## 1 12 24 21 0.3519050 POINT (-112.6655 27.18232)
## 2 153 35 41 0.7324870 POINT (-110.4624 24.13389)
## 3 157 26 30 0.8810290 POINT (-110.096 24.0195)
## 4 159 22 15 0.1879650 POINT (-113.3161 27.52944)
## 5 160 48 36 0.3651910 POINT (-112.5296 27.40498)
## 6 161 64 63 0.2791050 POINT (-112.986 27.0367)
## 7 162 57 41 0.6136198 POINT (-112.408 27.2028)
## 8 163 21 21 0.4328730 POINT (-110.951 24.2115)
## 9 166 19 26 0.2673030 POINT (-112.0806 25.91409)
## 10 168 28 25 0.4964650 POINT (-111.2156 25.55757)
For R to understand what the coordinate data mean, they need to be specified in terms of a Coordinate Reference System.
## Simple feature collection with 29 features and 4 fields
## geometry type: POINT
## dimension: XY
## bbox: xmin: -114.2935 ymin: 23.2855 xmax: -109.327 ymax: 29.32541
## epsg (SRID): 3857
## proj4string: +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs
## First 10 features:
## Site Males Females Suitability geometry
## 1 12 24 21 0.3519050 POINT (-112.6655 27.18232)
## 2 153 35 41 0.7324870 POINT (-110.4624 24.13389)
## 3 157 26 30 0.8810290 POINT (-110.096 24.0195)
## 4 159 22 15 0.1879650 POINT (-113.3161 27.52944)
## 5 160 48 36 0.3651910 POINT (-112.5296 27.40498)
## 6 161 64 63 0.2791050 POINT (-112.986 27.0367)
## 7 162 57 41 0.6136198 POINT (-112.408 27.2028)
## 8 163 21 21 0.4328730 POINT (-110.951 24.2115)
## 9 166 19 26 0.2673030 POINT (-112.0806 25.91409)
## 10 168 28 25 0.4964650 POINT (-111.2156 25.55757)