# How to find alpha and beta from a Gamma distribution?

The task: Using the method of moments model the data (sample) as a set of 20 independent observations from a Gamma(λ, k) distribution.

I have found the mean and variance but unsure how to find alpha and beta?

data = 100.2,90.6,47.7,24.7,77.5,88.8,168.7,87.2,102.5, 22.8,49.0,75.2, 123.7,182.3, 101.6,48.1,64.3,71.2,135.5,217.5
mu = (1/20)*sum(data)
u=0
for (i in 1:20){
u[i]=(data[i]-mu)^2
}
v = (1/20)*sum(u)
v


For a $\mathrm{Gamma}(\alpha, \beta)$ distributed variable $X$, expectation value (mean) $\mathrm{E}[X]$ and variance $\mathrm{Var}(X) = \mathrm{E}[(X - \mathrm{E}[X])^2]$ are related to parameters $\alpha, \beta$ as follows:
$$\mathrm{E}[X] = \frac{\alpha}{\beta}\,,$$ $$\mathrm{Var}(x) = \frac{\alpha}{\beta^2}\,.$$
$$\alpha = \frac{\mathrm{E^2}[X]}{\mathrm{Var}(x)}\,,$$
$$\beta = \frac{\mathrm{E}[X]}{\mathrm{Var}(x)}\,.$$