Revisión | cc26971bf365f62cd9c8d653569b062b971be431 (tree) |
---|---|
Tiempo | 2022-11-11 00:58:32 |
Autor | Lorenzo Isella <lorenzo.isella@gmai...> |
Commiter | Lorenzo Isella |
I send "" and "0" to NA and I now treat the case of a single lower bound for the interval.
@@ -108,11 +108,11 @@ | ||
108 | 108 | mutate(across(contains("bound") , ~ ifelse(.x == "", |
109 | 109 | NA_character_, .x))) |> |
110 | 110 | mutate(across(contains("bound"), ~as.numeric(.x))) |> |
111 | - mutate(estimated_value=(lower_bound+upper_bound)/2.) |> | |
111 | + mutate(estimated_value=if_else(!is.na(upper_bound),(lower_bound+upper_bound)/2., lower_bound) ) |> | |
112 | 112 | |
113 | 113 | ## only if you want to remove all the zeros |
114 | 114 | |
115 | - ## mutate(across(where(is.numeric), ~if_else(.x==0, NA_real_, .x))) |> | |
115 | + mutate(across(where(is.numeric), ~if_else(.x==0, NA_real_, .x))) |> | |
116 | 116 | select(-c(lower_bound, upper_bound)) |> |
117 | 117 | |
118 | 118 | mutate(granted_value_extended_eur = case_when( |