sp_transform_df: Transform the coordinates in a dataframe

View source: R/sp_transform_df.R

sp_transform_dfR Documentation

Transform the coordinates in a dataframe

Description

Transform the coordinates in a dataframe

Usage

sp_transform_df(
  df,
  to_crs,
  df_crs = 4283,
  x = "long",
  y = "lat",
  remove = TRUE
)

Arguments

df

Dataframe with x and y coordinates to transform.

df_crs, to_crs

Anything that will be recognised by the crs argument of sf::st_as_sf() and sf::st_transform().

x, y

Character name of column in df with x and y coordinates.

remove

Logical. If true, original coordinate columns (x and y) will be removed.

Value

Dataframe with added columns X and Y representing the transformed coordinates.


Acanthiza/envFunc documentation built on Aug. 19, 2024, 4:50 a.m.