focus()
works similarly toselect()
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. Extendingselect()
,focus()
will then remove the remaining column variables from the rows. This is whympg
does not appear in the rows above. Here’s another example with two variables:
Click through for the entire article.