diff --git a/R/prj_medium.R b/R/prj_medium.R index fbbfb610cc2fa45fff4f9fd1f68ee4d13f7b8fcc..1c634ea2aa7904f79c4adb31ba1ff607d6738e9f 100644 --- a/R/prj_medium.R +++ b/R/prj_medium.R @@ -544,16 +544,22 @@ new_prj_ph_property <- function(name, are_strings(name, type) - if (is.list(value)) { - are_null_or_strings(value[[1]]) - } else { - are_null_or_numeric(value) + if (!is.null(value)) { + if(is.list(value)){ + assertthat::assert_that(names(value[1]) == "expression") + are_null_or_strings(value[[1]]) + }else{ + are_null_or_numeric(value) + } } if (!is.null(dvalue)) { + is_wrapper_list(dvalue, "list") dvalue <- lapply(dvalue, function(x){ - are_null_or_strings(x[[1]]) - x[[2]] <- coerce_string_to_numeric(x[[2]]) + assertthat::assert_that( + all(names(x) %in% c("variable_name", "expression"))) + are_null_or_strings(x[["variable_name"]]) + x[["expression"]] <- coerce_string_to_numeric(x[["expression"]]) return(x) }) } @@ -571,15 +577,6 @@ new_prj_ph_property <- function(name, are_null_or_strings(parameter_name, curve) - # if (!is.null(independent_variable)) { - # independent_variable <- lapply(independent_variable, function(x){ - # x <- coerce_names(x, - # c("variable_name", - # "reference_condition", - # "slope")) - # }) - # } - if (!is.null(exponent)) { exponent <- coerce_names(exponent, c("variable_name", @@ -763,4 +760,4 @@ new_prj_com_property <- function(name, ), class = "prj_com_property" ) -} +} \ No newline at end of file