Virata manual

order

Moves columns to the front so they are the first thing you see.

What we have

  • moving a variable list to the front
  • after() and before(), to place it next to a named variable instead

Coming later

  • order, alphabetic

How you write it

order varlist

Square brackets mean optional. A vertical bar means choose one.

What it does

Purely cosmetic, and genuinely useful. order id state sector puts the identifiers first, so list and browse show you what you need to orient yourself instead of whatever column happened to be created first.

Try it

Every example below was run after sysuse vira.sample02, clear.

. order state sector
The same thing in pandas and in R

pandas

df = df[['state', 'sector', 'village', 'stratum', 'sex', 'age', 'education', 'hhsize', 'mpce', 'wage', 'multiplier']]

R

# no R form for `order` yet -- see docs/r-equivalents.md

Nearby

generate replace egen recode rename drop