It may be a vacuum leak on the intake manifold/throttle body, if not make sure your IAC (idle air control) is functioning OK.
Most likely bad intake manifold gasket. When the engine is cold the engine shrinks which unseals the intake and allows a small amount of unregulated air into the engine causing it to idle rough. as the engine heats up it expands sealing the leak causing idle to improve. You should also get lean codes from the computer as the engine is running to lean. Very common problem with the DOHC engine. See "Related Questions" below for more
throttle body or idle air control value
Almost all GM products idle rough when its cold but, if it continues it may be the tps swich.
What causes a car to idle good and run rough when you give it gas?
because that's kind of a big engine
This depends on the temperature outside and if your starting it cold. If you start it cold even in 60 degree weather it may idle rough for the first few minutes. You can solve this by letting the Wait to Start light to go out and then pressing the Throttle down slightly and letting off. This engages the high idle which should stop your vehicle from running rough for so long, as it lets the engine warm up faster.
You can start with the 02 sensor. if that does not fix the problem then you may have to consider the ECU.
Vacuum leek
Im guessing your asking @ what RPM is the 4 cylinder engine supposed to idel at. Well, theres usually two idle settings. A cold idle and a warm idle. You didint mention for what engine, and that's important because every engine has its own correct idle but to give ya a rough idea, the cold idle is usually 950-1000 RPM and warm idle is usually 850-900 RPM!
Check the motor mounts.
If an alternator is going bad it can cause a rough idle in a 1993 Subaru Legacy. Cold temperatures in the winter can also cause a rough idle in the Subaru Legacy.
The rough idle could be caused by a clogged egr valve or a stuck choke, among other things. Start by cleaning the egr valve then check the choke. Check the computer for possible codes to show other problems.