DDMMx_to_DD: DDMMx_to_DD

View source: R/DDMMx_to_DD.R

DDMMx_to_DDR Documentation

DDMMx_to_DD

Description

This utility will convert coordinates from various DDMM formats to Decimal degrees. The new decimal degrees fields will be added as new columns called "LAT_DD" and "LON_DD".

Usage

DDMMx_to_DD(
  df = NULL,
  format = "DDMMMM",
  lat.field = NULL,
  lon.field = NULL,
  WestHemisphere = T
)

Arguments

df

a dataframe to be analyzed. If left NULL, a value for db should be provided

format

the default is "DDMMMM", but "DDMMSS" is also valid. 'DDMMMM' values are typically cases where the degrees are followed by decimal minutes (with or without the decimal), such as 44°4.7' is written as "44047", "4404.7", "440470", or "4404.70". "DDMMSS" values can look identical, but the last four digits represent minutes and seconds. For example, the value of 44°4'42" would be written as "440442".

lat.field

the default is "LATITUDE". This is the name of the field holding latitude values (in decimal degrees)

lon.field

the default is "LONGITUDE". This is the name of the field holding longitudevalues (in decimal degrees)

WestHemisphere

the default is TRUE. It true, this ensure that all returned Longitudes are negative. If false, the original sign is retained.

Value

the original dataframe is returned, but it will have 2 additional fields - LAT_DD and LON_DD

Author(s)

Mike McMahon, Mike.McMahon@dfo-mpo.gc.ca

See Also

Other general_use: DDMMSS_to_DD(), aggregator(), clip_by_poly(), combine_lists(), df_qc_spatial(), df_sf_to_gpkg(), df_to_sf(), drop_cols(), prepare_shape_fields(), subset_by_time(), updateCheck()


Maritimes/Mar.utils documentation built on Feb. 12, 2024, 11:38 p.m.