Ergodic properties of affine transformations