diff --git a/R/load_meta_functions.R b/R/load_meta_functions.R index 0e45282..ba388ea 100644 --- a/R/load_meta_functions.R +++ b/R/load_meta_functions.R @@ -72,24 +72,28 @@ flatten_json <- function(json) group_count <- group_count(json) for(group_numb in group_count) { - if(!is.na(json [["Group"]][[group_numb]][["Instruments"]][["Thermo EASY-nLC"]][["Method"]][["Gradient"]][[group_numb]]["Time [mm:ss]"])) + gradient_data <- json [["Group"]][[group_numb]][["Instruments"]][["Thermo EASY-nLC"]][["Method"]][["Gradient"]][[group_numb]]["Time [mm:ss]"] + if(length(gradient_data) != 0) { - time <- c() - duration <- c() - flow <- c() - mixture <- c() - for(i in json [["Group"]][[group_numb]][["Instruments"]][["Thermo EASY-nLC"]][["Method"]][["Gradient"]]) + if(!is.na(gradient_data)) { - time <- c(time, i["Time [mm:ss]"][[1]]) - duration <- c(duration, i["Duration [mm:ss]"][[1]]) - flow <- c(flow, i["Flow [nl/min]"][[1]]) - mixture <- c(mixture, i["Mixture [%B]"][[1]]) + time <- c() + duration <- c() + flow <- c() + mixture <- c() + for(i in json [["Group"]][[group_numb]][["Instruments"]][["Thermo EASY-nLC"]][["Method"]][["Gradient"]]) + { + time <- c(time, i["Time [mm:ss]"][[1]]) + duration <- c(duration, i["Duration [mm:ss]"][[1]]) + flow <- c(flow, i["Flow [nl/min]"][[1]]) + mixture <- c(mixture, i["Mixture [%B]"][[1]]) + } + json [["Group"]][[group_numb]][["Instruments"]][["Thermo EASY-nLC"]][["Method"]][["Gradient"]] <- NULL + json [["Group"]][[group_numb]][["Instruments"]][["Thermo EASY-nLC"]][["Method"]][["Gradient"]][["Time [mm:ss]"]] <- time + json [["Group"]][[group_numb]][["Instruments"]][["Thermo EASY-nLC"]][["Method"]][["Gradient"]][["Duration [mm:ss]"]] <- duration + json [["Group"]][[group_numb]][["Instruments"]][["Thermo EASY-nLC"]][["Method"]][["Gradient"]][["Flow [nl/min]"]] <- flow + json [["Group"]][[group_numb]][["Instruments"]][["Thermo EASY-nLC"]][["Method"]][["Gradient"]][["Mixture [%B]"]] <- mixture } - json [["Group"]][[group_numb]][["Instruments"]][["Thermo EASY-nLC"]][["Method"]][["Gradient"]] <- NULL - json [["Group"]][[group_numb]][["Instruments"]][["Thermo EASY-nLC"]][["Method"]][["Gradient"]][["Time [mm:ss]"]] <- time - json [["Group"]][[group_numb]][["Instruments"]][["Thermo EASY-nLC"]][["Method"]][["Gradient"]][["Duration [mm:ss]"]] <- duration - json [["Group"]][[group_numb]][["Instruments"]][["Thermo EASY-nLC"]][["Method"]][["Gradient"]][["Flow [nl/min]"]] <- flow - json [["Group"]][[group_numb]][["Instruments"]][["Thermo EASY-nLC"]][["Method"]][["Gradient"]][["Mixture [%B]"]] <- mixture } } diff --git a/inst/bin/MARMoSET.exe b/inst/bin/MARMoSET.exe index 351ac96..c371953 100644 Binary files a/inst/bin/MARMoSET.exe and b/inst/bin/MARMoSET.exe differ diff --git a/inst/bin/MARMoSET.pdb b/inst/bin/MARMoSET.pdb index dcafc77..5ef65df 100644 Binary files a/inst/bin/MARMoSET.pdb and b/inst/bin/MARMoSET.pdb differ