This function turns a data.frame into a spatial object using a reasonable default projection.

coordinatize(
  dt,
  latname = "lake_lat_decdeg",
  longname = "lake_lon_decdeg",
  crs_in = 4326,
  crs_out = albers_conic()
)

Arguments

dt

data.frame

latname

character name of latitude column; default is "lake_lat_decdeg"

longname

character name of longitude column; default is "lake_lon_decdeg"

crs_in

numeric epsg code; default is 4326 WGS84-lat-long

crs_out

numeric epsg code; default is albers_conic

Examples

if (FALSE) { dt <- lagosus_load("locus") res <- coordinatize(dt$locus$lake_information) library(maps) map("state", xlim = c(-97.90363, -66.99892), ylim = c(34.61761, 49.41941)) plot(res$geometry, add = TRUE, pch = 19, cex = 0.05) }