R/extract_parent_file_hash.R

Defines functions extract_parent_file_hash

# extract_parent_file_hash
#
# @param hash_string data.frame, dataframe of old and new hashes with colnames hash and trackr_old_hash
#
# @importFrom stringr str_split
#
# @return character hash of parent file row hashes (first component of trackr_id)

extract_parent_file_hash <- function(hash_string){

  parent_file_hash <- lapply(stringr::str_split(hash_string$trackr_old_hash, '_'), head, n = 1) %>% unlist() %>% unique()
  
  return(parent_file_hash)
  
}
hamishgibbs/rtrackr documentation built on June 25, 2020, 8:16 p.m.