Why R value in signatures have to be 'calculated' values and not just a random numbers? This document (page 27) says that:


  The only significant difference between ECDSA and DSA is in the generation of $r$.



ECDSA $r = (kG)_x \bmod n$ and,
DSA:  $r=g^k \bmod p$


Why is it necessary to have a function that takes a random number $k$? Why do we cannot use the random $k$ directly as our $r$ value in the signatures?
The DSA signing algorithm involves the value $k$ not only at the step $r=g^k$, but also when calculating $s = k^{-1} (H(m)+rx)$.

So if you assign $r$ randomly, then you would need to calculate $k$ for the calculation of $s$, which is the dlog of $r$ to base $g$.

The argument of Biv's answer is of course valid too: If you choose $r$ randomly, you can't be sure that it is actually in the subgroup generated by $g$. In the verification process you need this fact, so that different powers of $g$ cancel each other out.

Considering ECDSA: Actually, it is exactly the same algorithm, just the additive notation instead of multiplicative. And of course, that the actual addition in elliptic curves have their own unique definition. For example, to calculate modular exponentiations, usually square-and-multiply is used. In additive notation, this is just called "double-and-add", as noted in the Wiki article as well.