I need to find estimate for the unknown $\theta$ with MLE using the R language if i'm given the following sample: $2, 2, 2, 2, 2, 8, 8, 8$. The sample is obtained from a discrete distribution with the rules:
$P(2) = \theta\quad \text{and}\quad P(8) = 1-\theta$