This is not a typo: $R$ is actually equal to $r$, see e.g. Sec. C.2.2 in Appendix C of these lecture notes, in particular compare Eq. (C.22) to Out[24] of the notebook. The notation $R$ is used to distinguish the function of $(x,y,z)$ from the coordinate $r$, but numerically, we have $r = R(x,y,z)$.