We can do it as follows:
Let the original vector be (x,y,z). Write it in spherical polar coordinates as
(R sin theta cos phi, R sin theta sin phi, R cos theta).
Consider this vector to be obtained by starting with the (0,0,R), rotating by theta in the z-x plane and then by phi in the x-y...