focus()works similarly to
select()from the dplyr package (which is loaded along with the corrr package). You add the names of the columns you wish to keep in your correlation data frame. Extending
focus()will then remove the remaining column variables from the rows. This is why
mpgdoes not appear in the rows above. Here’s another example with two variables:
Click through for the entire article.