get_UUID_from_file_path: Get the probable UUID of an object from its file name

get_UUID_from_file_pathR Documentation

Get the probable UUID of an object from its file name

Description

Problems and reserve selections saved from bdpg in rds files are given a file name with a specific syntax, i.e., "saved", object type, UUID, "rds". For example, saved.RSprob-COR-Base.489a016d-14fd-40af-89bb-3e1edf38f14f.rds This function decodes that file name and returns the UUID.

Usage

get_UUID_from_file_path(f)

Arguments

f

rds file name (possibly full path) containing a UUID

Value

Returns UUID section of the given file name

Examples

 get_UUID_from_file_path ("saved.RSprob-COR-Base.489a016d-14fd-40af-89bb-3e1edf38f14f.rds")

 long_path_part1 = "/Users/bill/tzar/outputdata/bdpgxupaper_single_action_COR_prob/"
 long_path_part2 = "default_runset/1_marxan_simulated_annealing/RSprob-COR-Base."
 long_path_part3 = "489a016d-14fd-40af-89bb-3e1edf38f14f"
 long_path_part4 = "/saved.RSprob-COR-Base.489a016d-14fd-40af-89bb-3e1edf38f14f.rds"
 long_path = paste0 (long_path_part1, long_path_part2, long_path_part3, long_path_part4)
 get_UUID_from_file_path (long_path)

langfob/bdpg documentation built on Dec. 8, 2022, 5:33 a.m.