R new syntax for ECMEN#229
Merged
ValerioGiuffrida merged 1 commit intomainfrom Feb 27, 2026
Merged
Conversation
ValerioGiuffrida
approved these changes
Feb 27, 2026
Comment on lines
+60
to
+65
| # If your HH size variable is not HHSize, rename here: | ||
| hh_size_var <- "HHSize" # <-- change if needed (e.g., "hh_size") | ||
|
|
||
| # If your MEB variables are named differently, rename here: | ||
| meb_var <- "MEB" # per capita MEB | ||
| smeb_var <- "sMEB" # per capita SMEB (optional) |
Contributor
There was a problem hiding this comment.
I would approach this differently.
It should be done so that not having MEB and SMEB prevents a silent failure.
Rather, we should have a noisy error, gracefully handled, as the data to complete the procedure is missing.
We must assume variables are standard at this stage, as the normalization of the dataset should have been already executed at this stage.
Comment on lines
+77
to
+84
| # 4) (Optional) quick overview for outliers (min/max/mean) | ||
| # ----------------------------- | ||
| exp_overview <- df %>% | ||
| summarise(across(all_of(all_exp_inputs), | ||
| list(min = ~min(.x, na.rm = TRUE), | ||
| max = ~max(.x, na.rm = TRUE), | ||
| mean = ~mean(.x, na.rm = TRUE)))) | ||
| exp_overview |
Contributor
There was a problem hiding this comment.
Data quality control and validation do not belong here.
#240
Comment on lines
+67
to
+70
| # Set these to your actual names if different | ||
| hh_size_var <- "HHSize" # household size | ||
| meb_var <- "MEB" # per-capita MEB | ||
| smeb_var <- "sMEB" # per-capita SMEB (optional) |
Contributor
There was a problem hiding this comment.
See above, at this stage variables must be already standardized or fail noisily as the dataset is incomplete to execute this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.