James G. answered 06/06/19
Tutor
4.7
(33)
Accomplished tutor specializing in Writing, Math, Accounting, and PM
You can use the order command in R with the given conditions for z and b.
df[with(df, order(-col1, col2)), ] or
dd[with(dd, order(-z, b)), ]