Let $R$ be a domain with affine spectrum $S$ and consider the scheme $X=\mathbb A^1_R=\operatorname {Spec}R[T] $ over $S$.

Let $P\subset R[T]$ be an ideal with $P\cap R=0$ and let $Y\subset X$ be the associated subscheme. The extension of $P$ to $(\operatorname {Quot}(R))[T])$ is principal, generated by some polynomial $f$ which we may assume has coefficients in $R[T]$. What is the relationship between $Y$, the subscheme $V(f)\subset X$ and (probably) inverse images of subschemes in $S$ ?

(I have asked this question three days ago on math stackexchange but got no answer nor comment)

Edit: I'm also interested in knowing if one can say more under the assumption that $P$ is prime.