  We show that an $R^d$-topological dynamical system equipped with an invariant
ergodic measure has discrete spectrum if and only it is $\mu$-mean
equicontinuous (proven for $Z^d$ before). In order to do this we introduce mean
equicontinuity and mean sensitivity with respect to a function. We study this
notion in the topological and measure theoretic setting. In the measure
theoretic case we characterize almost periodic functions and in the topological
case we show that weakly almost periodic functions are mean equicontinuous (the
converse does not hold).
