{smcl} {* 27 Aug 2004}{...} {hline} help for {hi:reorder} {hline} {title:Reorder variables in dataset, reversibly} {p 8 17 2}{cmd:reorder} {it:varlist} {p 8 17 2}{cmd:reorder,} {cmdab:prev:ious} {title:Description} {p 4 4 2}{cmd:reorder} {it:varlist} changes the order of the variables in the current dataset. The variables specified are moved, in order, to the front of the dataset. {cmd:reorder} used in this way resembles {help order}, except that the {it:varlist} specified is saved in a characteristic. {p 4 4 2}{cmd:reorder, previous} changes the order of the variables in the current dataset to the order previously set with {cmd:reorder}. This applies not only in the current session, but also in subsequent sessions {c -} so long as the dataset, including the characteristic, is saved using {cmd:save, replace}. Thus after some initial {cmd:reorder} successive applications of {cmd:reorder, previous} can be used to toggle back and forth between two orderings. {title:Options} {p 4 8 2}{cmd:previous} specifies that the order of variables should return to that previously specified by {cmd:reorder} with the same dataset. {title:Examples} {p 4 8 2}{inp:. reorder price-foreign} {p 4 8 2}{inp:. reorder, previous} {title:Author} {p 4 4 2}Nicholas J. Cox, University of Durham, U.K.{break} n.j.cox@durham.ac.uk {title:Acknowledgements} {p 4 4 2}This problem was suggested by Susan Hailpern. Kit Baum made helpful comments. {title:Also see} {p 4 17 2}On-line: help for {help order}{p_end} {p 4 17 2}Manual: {hi:[R] order}