imd_decile %in% 1:3 ~ "Deprived", TRUE ~ "Not deprived"
Would recode as:
imd_decile %in% 1:3 ~ "Deprived", imd_decile %in% 4:10 ~ "Not deprived", TRUE ~ "ERROR"
This way, you get to check incorrect inputs.
imd_decile %in% 1:3 ~ "Deprived", TRUE ~ "Not deprived"
Would recode as:
imd_decile %in% 1:3 ~ "Deprived", imd_decile %in% 4:10 ~ "Not deprived", TRUE ~ "ERROR"
This way, you get to check incorrect inputs.
Printscreen of the R Studio ‘Options’ page, highlighting the ‘Workspace’ section.
Not sure this caption is necessary
Start
If you use RStudio start with a clean ...
Tips for effective R scripting
Need to highlight that R and RStudio (note the lack of space) are separate entities, it's possible, though unlikely that someone might have R installed but not RStudio.
Making edits with code enables you to keep track of all the steps you have taken.
Creating a script that processes the raw data and creates a new version enables you to keep track of all the steps you have taken.
Use <- not = for assignment.
Worth explaining why
Printscreen of the R Studio STYLER section within Addins.
Image of the RStudio 'STYLER' section of 'Addins'.
Printscreen of the R Studio console, highlighting Addins button.
Image of the RStudio toolbar with the Addins button highlighted.
Once this is installed (which only needs to be done once), you can click the ‘Addins’ button. Then scroll down to the ‘STYLER’ section and click ‘style active file’.
Once this package is installed (which only needs to be done once), you use an 'Addin' in RStudio. Click the ‘Addins’ button, scroll down to the ‘STYLER’ section and click ‘style active file’.
best practices
replace with guidelines