As mentioned by @MrYouMath, you can use Barlow's Formula (see 1, [2] with a calculator for US units). In short the equation is
$$P = \frac{2 S_y t}{d}$$
where:
- P: pressure
- $S_Y$: allowed yield stress
- $d$ : diameter
- $t$ : thickness.
if you are solving for the thickness:
$$t = \frac{d}{2 S_y P} = \frac{r}{ S_y P} $$
keep in mind the following:
- In (the unlikely) case you end up with $d<20 t$, then the assumptions do not hold and you shouldn't use the results. You should use either FE, or analysis that can't be covered in this paragraph.
- Regarding the selection diameter, you are better off selecting the outer diameter. Especially if $d>20 t$, there won't be any noteworthy difference. (consider the selection of sheet metal thickness for the pipe).
- It is highly recommended, to use a safety factor N(>1). The factor should be proportional to the hazard caused by the failure of the pipe. (e.g. if you carrying a toxic fluid, or if the pressure in the pipe is so high that essentially its a bomb). In that case the equation turns into:
$$t = \frac{d\cdot N}{2 S_y P} = \frac{r\cdot N}{ S_y P} $$