Stability analysis of dynamical systems via R-functions