Let G = (V, E) be a finite graph and r =>= 1 be an integer. For v is an element of V, let B-r(v) = {x is an element of V : d(v, x) <= r} be the ball of radius r centered at v. A set C subset of V is an r-dominating code if for all v is an element of V, we have B-r(v) boolean AND C not equal empty set; it is an r-locating-dominating code if for all v is an element of V, we have B-r(v) boolean AND C not equal empty set, and for any two distinct non-codewords x is an element of V \ C, y is an element of V \ C, we have B-r(x) boolean AND C not equal B-r(y) boolean AND C; it is an r -identifying code if for all v is an element of V, we have B-r(v) n C not equal O, and for any two distinct vertices x is an element of V, y is an element of V, we have B-r(x) n C not equal B-r(y) boolean AND C. We denote by gamma(r)(G) (respectively, ld(r)(G) and idr(G)) the smallest possible cardinality of an r-dominating code (respectively, an r-locating-dominating code and an r-identifying code). We study how small and how large the three differences id(r)(G)-ld(r)(G), id(r)(G)-gamma(r)(G) and ld(r)(G) - gamma(r)(G) can be.