get_heading: Get heading based on lon and lat

View source: R/get_heading.R

get_headingR Documentation

Get heading based on lon and lat

Description

Nautilus calculates errors as a function of bearing and target aspect and therefore requires heading (or bearing) for ownship and for each target. If the truth data already contains this information then this function is unnecessary. If not, then the user will be required to run get_heading() before inputting the data into target_track_distance().

get_heading() uses the bearing() function from the package geosphere. For each point, get_heading() calculates the bearing between the current point and the previous point as well as the current point and the following point. get_heading then averages these two numbers and returns the average as the bearing column of the output.

Usage

get_heading(dataSet, truthIDColName = "truthID")

Arguments

dataSet

data frame with lon, lat, time, and target/track identifiers

truthIDColName

(default="truthID") (string) the name of the column with target/track identifiers

Value

dataSet with an additional column, heading, that is the average heading at each point.

Examples

get_heading(example1_scenario$targetTruth, "truthID")

battleVerse/scenarioMaker documentation built on July 16, 2024, 4:21 a.m.