Summation
We use the symbol $\Sigma$ to denote sums.
In R, the sum function adds numbers.
Explanation
If $x=(4,5,3,7)$ then
$$
\sum_{i=2}^{4} x_i = x_2+x_3+x_4 = 5+3+7 = 15 .
$$
Within R:
\begin{verbatim}
> x<-c(4,5,3,7)
> x
[1] 4 5 3 7
> sum(x)
[1] 19
>
\end{verbatim}
Examples
\begin{xmpl}
If $x=(4,5,3,7)$
then
$$\sum_{i=1}^{4} x_i = x_1+x_2+x_3+x_4 = 4+5+3+7 = 19
$$
and
$$
\sum_{i=2}^{4} x_i = x_2+x_3+x_4 = 5+3+7 = 15 .
$$
Within R one can give the corresponding commands:
\begin{lstlisting}
x<-c(4,5,3,7)
x
[1] 4 5 3 7
sum(x)
[1] 19
sum(x[2:4])
[1] 15
\end{lstlisting}
\end{xmpl}