Closed dfalster closed 8 months ago
@ehwenk suggested
this will make it easier to maintain and lead to fewer merge conflicts
library(tidyverse) library(traits.build) ids <- dir("data") metadata <- map(ids, ~read_metadata(sprintf("data/%s/metadata.yml", .x))) # function to update a single file f <- function(m){ if(!is.na(m$taxonomic_updates[1])) m$taxonomic_updates <- m$taxonomic_updates %>% util_list_to_df2() %>% arrange(find) %>% mutate(taxonomic_resolution = tolower(taxonomic_resolution)) m } # apply updates metadata_updated <- map(metadata, f) # save to file walk2(metadata_updated, ids, ~ write_metadata(.x, sprintf("data/%s/metadata.yml", .y)))
@ehwenk suggested
this will make it easier to maintain and lead to fewer merge conflicts