What is $R$ in the formula for escape velocity? From the escape velocity formula
$$v_e = \sqrt \frac {2GM}R.$$
Some sources say it is the distance between two objects with mass $M$ and $m$. 
Some examples I have read, only used radius of the $M$. For simplicity sake, lets use a rocket and planet Earth.
I google the escape velocity  of earth as 11.186 km/s. I looked through example such as this. This particular example said that the escape velocity is
\begin{align}
v_e & = \sqrt {2gR} 
\\ & = \sqrt {2\times9.8\:\mathrm{m/s^2} \times6.4\times10^3\:\mathrm{km}} 
\\ & = 11.2 \: \mathrm{km/s}
\end{align}
I do know that $g = \frac {GM}{R^2}$, but in this example, the escape velocity is calculated using r as radius of earth. The radius of the Earth according to google is 6371 km or 6.4e6 (the value used for the calculation).
My question is, $R$ the radius of of the earth ($M$) or the distance between the rocket ($m$) and Earth? What I think makes sense is the radius of the Earth ($M$) because how could escape velocity be calculated without knowing the height it has to travel. 
To add about the info Distance from M and m, Some sources say that R is actually 
$$R = r_e + h_\mathrm{atmosphere}$$
 A: In order to really understand what this formula means, let's see how to derive that. Let $m$ be the mass of a body on the surface of Earth and let $R_\mathrm{Earth}$ be Earth's radius. Our aim is to calculate the initial velocity the body needs, to "escape" from Earth gravitational field. "Escaping", in this context, means to reach the infinity, where the gravitational field is known to be null. Plus, the escape velocity is defined as the minimum velocity needed, physically this means that our body reach the infinity with no more velocity $v_\infty = 0$. 
Let's start from energy conservation principle:
$$E = \frac{1}{2}mv_0^2-\frac{M_\mathrm{Earth} m G}{R_\mathrm{Earth}}$$
We've just sad the potential at infity is zero, same for the velocity. Thus we have
$$\frac{1}{2}mv_0^2-\frac{M_\mathrm{Earth} m G}{R_\mathrm{Earth}}=0.$$
Solving this equation for $v_0$ we get:
$$v_0=\sqrt \frac{2M_\mathrm{Earth}G}{R_\mathrm{Earth}}.$$
If we do not consider air friction, there are no reasons why we should consider the existence of atmosphere.
A: Technically, "R" is the radius between the centre of the Earth (or whatever body you're using) and the rocket.  That $11.186 \:\rm km/s$ is the escape velocity at the surface of the Earth, but a hundred kilometers above the Earth the escape velocity is $11.099\:\rm km/s$.
Assuming that you reach escape velocity then begin to coast, your velocity will be constantly decreasing because the pull of the Earth is still acting on your spacecraft.  One million kilometers from Earth your speed may have decreased to $1\:\rm km/s$, but that's okay because at that distance the escape velocity is still $0.89\:\rm km/s$.
Hope that helps.
A: R is fundamentally the distance of the spaceship and the celestial. (Read: the ships distance from the planet's centrum exactly at the time it attains the velocity yielded by the formula) Therefore escape velocity depends on where you start from: to leave Earth launching from its surface is much harder than to escape from GEO.
But, to make "gravity wells" of planets comparable, that is to assign numbers to them, indicating reasonably the difficulty of the escape, we must agree on R. Since rockets usually launch from planetary surfaces, escape velocities are calculated using planetary radius as R.
But, since interplanetary missions often have separate stages for orbit insertion and escape burns (or could in the future start out from orbiting outposts),  it is also instructive to give escape velocity starting from low orbit (that is, from the height $R_\mathrm{planet}+h_\mathrm{atmosphere}$) In this case one has simply to subtract her orbital speed from the escape velocity to attain the $\Delta v $ needed to reach interplanetary space
A: It is always the distance between the two objects that accounts for the escape velocity. The escape velocity for earth is calculated from the surface of the earth. On the surface, the escape velocity turns out to be around $11.2 \:\rm km/s$. $R$ given in the problem is the initial distance between the object and the mass's center which also turns out to be the radius of the Earth as we are launching rockets from the surface of the earth. As we go up the distance between the rocket and earth increases and hence the escape velocity decreases. 
A: $R$ is the distance between the centres of either object. By centres I mean their centres of mass (the point their gravitational forces "pull" from, so to speak).
$R$ is thus the sum of Earth's radius $R_e$, the object's radius $r_o$ (if spherical) and the height $h$ it is located above the ground:
$$R=R_e+h+r_o$$
For small objects not-too-far from the ground (such as thrown stones, fired rockets and orbiting satellites) you'll often see the radius of the object and the distance neglected. A rock's or a satellite's small radius is negligible compared to the ~6400 km of the Earth. Adding maybe 1km or even 10km or 100km in distance to this number makes no practical difference.
$$R=R_e+h+r_o\approx R_e$$
But when calculating escape velocity of e.g. Pluto's moon from Pluto, two objects that are comparable in size, you can't neglect either radius. And when calculating escape velocity of our own Moon from Earth, the ~400 000km distance must certainly be included as well (the sizes are almost negligible compared to this).
