I'm trying to wrap my head around the following line done in my physics textbook:
$\vec\nabla f(r) = \begin{pmatrix} f'(r) \frac{\partial r}{\partial x}\\ f'(r) \frac{\partial r}{\partial y}\\ f'(r) \frac{\partial r}{\partial z} \end{pmatrix}$
Where $r$ represents the distance between the origin and some object (int three dimensional space). Therefore I could write it as $r = \sqrt{x^2 + y^2 + z^2}$.
As far as I know $\vec\nabla$ represents a vector, which components are the partial derivatives of a given function and $\vec\nabla f(r)$ should be equal to $\begin{pmatrix}\frac{\partial f}{\partial r} \end{pmatrix}$ or simply $f'(r)$ since $f(r)$ only depends on $r$. I could write $f(r)$ as a function of $x,y,z$ and
$\vec\nabla f(x,y,z)$ would be equal to $\begin{pmatrix} \frac{\partial r}{\partial x}\\ \frac{\partial r}{\partial y}\\ \frac{\partial r}{\partial z} \end{pmatrix}$
How do I get the result of my textbook and what part did I misunderstand?