diff --git a/R/load_meta_functions.R b/R/load_meta_functions.R index 0e45282..03ff1a9 100644 --- a/R/load_meta_functions.R +++ b/R/load_meta_functions.R @@ -70,9 +70,9 @@ flatten_json <- function(json) assertive.types::assert_is_list(json) group_count <- group_count(json) - for(group_numb in group_count) + for(group_numb in seq_len(group_count)) { - if(!is.na(json [["Group"]][[group_numb]][["Instruments"]][["Thermo EASY-nLC"]][["Method"]][["Gradient"]][[group_numb]]["Time [mm:ss]"])) + if(is.element("Gradient", names(json [["Group"]][[group_numb]][["Instruments"]][["Thermo EASY-nLC"]][["Method"]]))) { time <- c() duration <- c()