We measured the thermal expansion (a) of two rare earth nickel borocarbides, RNi2B?2C (where R=Yb (Ytterbium) or Lu (Lutetium)), using capacitative dilatometry. We observed the effects of temperature and magnetic field variations on the thermal expansion of the two materials. The thermal expansion of the Lu compound increases with temperature increase and is relatively unaffected by a high magnetic field (18T). In YbNi2B?2C, a has stronger temperature dependence below about 10K. At B=0T, the thermal expansion begins to decrease at a very rapid rate and goes to zero as the temperature decreases. At B=18T, an increase in a is observed with the decrease in temperature. This magnetic field and temperature dependence of the Yb compound is due to its heavy fermion behavior at low temperatures (T<10K). The observed behavior of YbNi2B?2C is not well understood and requires further investigation.