Sort a data frame column based on another sorted column value in R
You can simply arrange by two columns:

library(dplyr)

df %&gt;%
   arrange(desc(var2),var1)


Edit:

To clarify why this works, in your example simply arranging the df by var2 in descending order will already put all 0 and NA values at the bottom (since NA is "worth" less than 0). However since these  rows all have the same value their order will be "random" because we do not specify a tie method. By supplying a second column for arrange, we sort all ties by a second criteria, var1.

This will actually also re-arrange rows with a duplicate var2 value as well but that should be a bonus.