Let $k$ be a field. Let $R$ be an $k$-algebra.
Let $X = \operatorname{Proj}(\frac{k[x,y,z]}{f})$ where $f$ is a degree $d$-homogenous polynomial. ($d > 1$)
Now consider the variety $X_R =X \times_{\operatorname{Spec(k)}} \operatorname{Spec}(R)$. Then $X_R = \operatorname{Proj}(\frac{R[x,y,z]}{f}) $.
Now I can use the ideal sheaf exact sequence for the closed embedding $f:X_R \to \mathbb{P}_2(R)$
$$ 0 \to \mathcal{O}_{\mathbb{P}_2(R)}(-d) \to \mathcal{O}_{\mathbb{P}_2(R)} \to f_{*}\mathcal{O}_{X_R} \to 0$$
From which we get $H^0(\mathbb{P}_2(R), \mathcal{O}_{\mathbb{P}_2(R)} ) \cong H^0(\mathbb{P}_2(R), f_{*}\mathcal{O}_{X_R} ) = H^0(X_R, \mathcal{O}_{X_R})$. So,$ H^0(X_R, \mathcal{O}_{X_R}) = R$?
I just want to verify if the above computation is correct? Or am I making mistake somewhere?