Spontaneous R -parity breaking in supersymmetric models