View source: R/showDistanceToTarget.R
showDistanceToTarget | R Documentation |
This function generates a plot of the distance to a target over time or some other associated parameter in the object. It also draws a horizontal line to indicate the target radius and a red segment that shows the start and length of a parameter associated with the 'obj'.
showDistanceToTarget(obj, ...)
obj |
An object that must contain at least three elements: distance:A numeric vector representing the distance to the target targetRadious: A numeric value indicating the target radius. r:An object containing at least two elements: - start: A numeric value representing the start of the range. - length: A numeric value representing the length of the range. |
... |
Additional parameters of object. |
This function generates a line plot of the distance to a target (stored in 'obj$distance'). It also draws a red horizontal line at the value of 'obj$targetRadious' to indicate the target's radius. Additionally, a red vertical segment is drawn to show the start of the range defined by 'obj$r$start' and the length defined by 'obj$r$length'.
A plot showing the relationship between the object's position and the target's position.
# Create a fictional object with example data
obj <- list(
distance = rep(c(5, 10, 15, 20, 15, 10, 5),5),
targetRadious = 12,
r = list(start = 2, length = 10)
)
# Visualize the distance to the target using the function
showDistanceToTarget(obj)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.