R/do_coords.R

Defines functions do_coords

# assign consitent lat/lon variables to be able to act on data inputs
# more easily - and save original column names to rename data on return

do_coords <- function(x, lat, lon) {
  x <- guess_latlon(x, lat, lon)
  if (is.null(attr(x, "lat_var_orig"))) attr(x, "lat_var_orig") <- lat
  if (is.null(attr(x, "lon_var_orig"))) attr(x, "lon_var_orig") <- lon
  return(x)
}

Try the scrubr package in your browser

Any scripts or data that you put into this service are public.

scrubr documentation built on June 12, 2021, 9:06 a.m.