R density loops set up (ON WINDOWS)