For the sake of diagnosing, I have installed new spark plugs, spark plug wires and boots, new engine coil packs, EGR valve, EGR modulator, new tubes in the EVAP system, vacuum switch valve, vacuum control valve, Purge solenoid and a new Idle Air Control valve.
My car is having a rough idle every once in a while (and seemingly getting worse) and would hesitate accelerating because of whatever issue is going on. There are no audible sounds but it feels like the car is kicking while trying to accelerate and there is a hesitation to the acceleration. It also has a rough idle just sitting in drive or reverse with the brake on. This only happens in drive and reverse.
It would help with diagnosis if you included the vehicle year, make and model with engine size. Since the engine is running good out of gear and only gets rough when in gear you either have a bad motor or a transmission mount that is not supporting the engine and allows excessive movement when accelerating.