The nitrite ion (NO\(_2^-\)) is an ambident nucleophile, meaning it can attack from two different sites (N or O). Using silver nitrite (AgNO\(_2\)), where the Ag-O bond is more covalent, favors attack from the nitrogen atom, forming a nitroalkane (R-NO\(_2\)). Using an ionic nitrite like NaNO\(_2\) favors attack from the oxygen, forming an alkyl nitrite (R-O-N=O).