camr_join_and_mutate
A function is proposed with no current implementation.
It is often necessary to join a table only to derive a value from a single column in that table. In these cases, joining the table may add many superfluous columns. The following steps are typically performed in sequence with the interests of keeping tables clean of these extra columns.
df_a |>
left_join(df_b) |>
mutate(
AcolN = Acol3 - Bcol4
) |>
select(-c(Bcol1, Bcol2, Bcol3)
Given the CAM naming convention, the last line selecting out columns of df_b
can usually be replaced with select(-discard(colnames(df_b), str_detect, '^IDX\\.'))
1. This common workflow can be replaced with a safe join that takes into account our style conventions.
Edited by Pascale, Michael Philip