project_data: Project user-supplied locations

Description Usage Arguments See Also Examples

View source: R/project_data.r

Description

Given an input dataframe containing locations (given in decimal degrees or meters), projects these locations and, if desired, appends them to the dataframe. May also be used to back-project to Latitudes/Longitudes provided the input was projected using a Lambert azimuthal equal-area projection.

Usage

1
2
3
4
5
6
7
project_data(
  Input,
  NamesIn = NULL,
  NamesOut = NULL,
  append = TRUE,
  inv = FALSE
)

Arguments

Input

dataframe containing - at the minimum - Latitudes and Longitudes to be projected (or Y and X to be back-projected).

NamesIn

character vector of length 2 specifying the column names of Latitude and Longitude fields in the Input. Latitudes (or Y) name must be given first, e.g.:

NamesIn=c('MyLatitudes','MyLongitudes').

NamesOut

optional. Names of the resulting columns in the output dataframe, with order matching that of NamesIn (e.g., NamesOut=c('Y','X')).

append

TRUE or FALSE. Should the projected locations be appended to the Input?

inv

TRUE or FALSE. Should a back-projection be performed? In such case, locations must be given in meters and have been projected using a Lambert azimuthal equal-area projection.

See Also

assign_areas.

Examples

1
2
3
4
5
6
#Generate a dataframe
MyData=data.frame(Lat=runif(100,min=-65,max=-50),
                  Lon=runif(100,min=20,max=40))

#Project data using a Lambert azimuthal equal-area projection
MyData=project_data(Input=MyData,NamesIn=c("Lat","Lon"))

CCAMLRGIS documentation built on Sept. 8, 2021, 9:09 a.m.