Magnetic properties of RCo4B compounds where R = Y, Pr, Nd, Gd and Er