Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: minor complaint


From   Tirthankar Chakravarty <[email protected]>
To   [email protected]
Subject   Re: st: minor complaint
Date   Mon, 19 Jul 2010 00:19:14 +0530

Maybe you can use numlists for this task?

*********************************
 local mylist 0.5 2.5 12 9 7 2 23 32
 numlist "`mylist'", sort
 di "`r(numlist)'"
*********************************


2010/7/19 Jeph Herrin <[email protected]>:
> Is there an obvious reason why the list directives
> for locals include a -sort- for text but not a -sort-
> for numbers?
>
>  local mylist 0.5 2.5 12
>  local mylist : list sort mylist
>  macro list _mylist
>
> Many tasks involve sorting lists, it would be a lot
> easier if I did not always need to write a bubble sort.
>
> Or is there another way to easily sort a numeric list
> stored in macro?
>
> cheers,
> Jeph
>
>
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>



-- 
To every ω-consistent recursive class κ of formulae there correspond
recursive class signs r, such that neither v Gen r nor Neg(v Gen r)
belongs to Flg(κ) (where v is the free variable of r).

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index