The Weizmann Institute published a study in Nature Neuroscience that has suggested people can actually learn as they sleep which indeed alters their behavior when they are awake.
This study consisted of allowing the individuals to fall asleep. Once noted that they were asleep a tone would be played with a certain odor following. Both pleasant odors and unpleasant odors were presented, each with separate sounding tones. Researchers also had a control tone with no odor. The Researchers carefully examined the conditioned behavior of the individual sniffing after the tone was played. Long deep sniffs were noted as well as short and shallow. This learned behavior continued as they would expose the individuals to a tone without an odor that noted an appropriate sniff
Upon waking the individuals, the researchers found that playing the pleasant odor tone resulted in the individual having a long deep sniff pattern. After the unpleasant odor tone was played a shorter, shallower sniff followed.
The Researchers also examined if an individual was able to learn this behavior while in REM sleep and found that sleep learning did occur in only Non-REM sleep.