I have proved the following:

If $G$ is a free abelian group of rank $n$ and $H$ is a subgroup of $G$, then $H$ is free of rank $m\leq n$. Moreover, there exists a $\mathbb{Z}$-basis $x_1,\ldots,x_n$ for $G$ and $a_1,\ldots,a_m \in \mathbb{Z}$ such that $a_1x_1,\ldots,a_mx_m$ is a $\mathbb{Z}$-basis for $H$.

Does this theorem generalize if I replace $\mathbb{Z}$ by any PID $R,$ "abelian group" by "$R$-module" and "subgroup" with "submodule"?

Many thanks!