Hint: We should also consider if urns are distinguishable or not. If this is not explicitly stated, we typically assume they are indistinguishable (but should state this assumption in an answer). Here is an example with $n=3$ balls and $r=4$ urns.
We think of $N=\{1,2,3\}$ as a set of balls and of $R=\{a,b,c,d\}$ as a set of urns. A function $f:N\rightarrow R$ is considered as placing each ball into some urn.
We consider four functions $j,k,l,m: N\rightarrow R$ by
\begin{array}{lclcllcl}
j(1)&=&j(2)&=&a,&\qquad j(3)&=&b\\
k(1)&=&k(3)&=&a,&\qquad k(2)&=&b\\
l(1)&=&l(2)&=&b,&\qquad l(3)&=&d\\
m(2)&=&m(3)&=&b,&\qquad m(1)&=&c\\
\end{array}
Four functions with distinguishable balls and urns:

with balls indistinguishable:

with urns indistinguishable:

with balls and urns indistinguishable:

Note: Some more information is given in this answer.