I have so many photos on my iMac (running OSX El Capitan) and hence on i Cloud that they nearly fill the memory on my iPhone 4. Is there any way in which I can select only those photos I want from iCloud to appear on my phone?
If you are using only My Photo Stream and iCloud Photo Sharing, the many photos on your Mac cannot be filling your iPhone.
Only iCloud Photo Library is storing all photos in iCloud and updating them on all devices.
My Photo Stream will stream the 1000 most recent photos to your iPhone. They will vanish after some time, if you do not save them to your Camera Roll. Shared Albums will download all photos to your device, a bit smaller than on your Mac.
But there is no optimize to reduce the amount of photos in these iCloud items. The only way to have access to all photos would be iCloud Photo Library, but that requires a paid storage plan if your Photos Library is large.