Calculate latitude and longitude variables (columns) containing the geographic centroid of each trip
Arguments
- dat
String or data frame. A string for the name of the main data table in the FishSET database (contains 'MainDataTable' in the name). Or a data frame of the main data table.
- project
String. Project name.
- lon
String. Column name in
datcontaining longitudinal data.- lat
String. Column name in
datcontaining latitudinal data.- trip_id
String. Column name that represents the unique trip identifier in
dat.- weight_var
String. Optional. Column name in
datto use for computing a weighted average centroid. IfNULL(the default), an unweighted (simple) average is calculated.
Value
Returns the original data frame (dataset) with two new columns added:
cent_lon (centroid longitude) and cent_lat (centroid latitude).
