Create latitude and longitude variables containing the centroid of each trip
     
    
    Usage
    create_trip_centroid(dat, project, lon, lat, tripID, weight.var = NULL)
 
     
    
    Arguments
    - dat
 
Primary data containing information on hauls or trips. Table in the FishSET database contains the string 'MainDataTable'.
 
- project
 
Project name.
 
- lon
 
Variable in dat containing longitudinal data.
 
- lat
 
Variable in dat containing latitudinal data.
 
- tripID
 
Variable in dat containing trip identifier. If trip identifier should be defined by more than one variable then list as c('var1', 'var2').
 
- weight.var
 
Variable in dat for computing the weighted average.
 
 
    
    Value
    
Returns the primary dataset with centroid latitude and centroid longitude variables added.
     
    
    Details
    Computes the average longitude and latitude for each trip. Specify weight.var to calculate the weighted centroid.
  Additional arguments can be added that define unique trips. If no additional arguments are added, each row will be treated as a unique trip.
     
    
    Examples
    if (FALSE) {
pollockMainDataTable <- create_trip_centroid(pollockMainDataTable, 'pollock', 'LonLat_START_LON', 
  'LonLat_START_LAT', weight.var = NULL, 'DISEMBARKED_PORT', 'EMBARKED_PORT')
}