This function returns coordinates for all unique locations in supplied data.

get_pop_vec(data, orig = TRUE, dest = TRUE)

Arguments

data

generalized data frame described in travel_data_template or derivative thereof

orig

logical indicating whether to include origin location in unique names (default= TRUE)

dest

logical indicating whether to include destination location in unique names (default= TRUE)

Value

two column dataframe containing unique names

See also

Author

John Giles

Examples

x <- cbind(travel_data_sim, get_unique_ids(travel_data_sim, adm_start=2)) # Unique coordinates for all locations get_pop_vec(x)
#> A B C D E F G H I J K L M #> 5065 8179 3961 5540 1337 5776 623 255 21284 85 1112 9542 7596 #> N O Q R S T U V W Y Z #> 2839 6360 4449 609 7515 1846 7355 240 11983 9603 14619
# Origins only get_pop_vec(x, dest=FALSE)
#> C D E G H I J K N O Q R S #> 3961 5540 1337 623 255 21284 85 1112 2839 6360 4449 609 7515 #> T V Y Z #> 1846 240 9603 14619
# Destinations only get_pop_vec(x, orig=FALSE)
#> A B C D E F G H I J K L M #> 5065 8179 3961 5540 8994 5776 4048 14445 16746 6716 1112 9542 7596 #> N O Q R S T U V W Y Z #> 2839 8603 4449 6184 7515 1846 7355 240 11983 14977 14619
# Without supplied ids get_pop_vec(travel_data_sim)
#> Added missing unique location names.
#> A_B_A A_B_B A_B_C A_B_D A_B_E A_B_F A_B_G A_B_H A_B_I A_B_J A_B_K A_B_L A_B_M #> 5065 8179 3961 5540 1337 5776 623 255 21284 85 1112 9542 7596 #> A_B_N A_B_O A_B_Q A_B_R A_B_S A_B_T A_B_U A_B_V A_B_W A_B_Y A_B_Z #> 2839 6360 4449 609 7515 1846 7355 240 11983 9603 14619