Learn R Programming

cayleyR (version 0.2.1)

find_closest_to_coords: Find Closest State to Target Coordinates

Description

Searches a table of reachable states for the state whose celestial coordinates are closest to a target coordinate set.

Usage

find_closest_to_coords(reachable_states, target_coords, v_cols)

Value

Single-row data frame of the closest state (with angular_distance column added)

Arguments

reachable_states

Data frame with columns theta, phi, omega_conformal, and V-columns for state

target_coords

List with component z (complex number)

v_cols

Character vector of V-column names

Examples

Run this code
# Typically used with output from get_reachable_states
# find_closest_to_coords(states_df, target_coords, paste0("V", 1:n))

Run the code above in your browser using DataLab