Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: RE: could numlist return a comma separated list?


From   Enzo Coviello <[email protected]>
To   [email protected]
Subject   Re: st: RE: RE: could numlist return a comma separated list?
Date   Fri, 18 Jun 2004 16:11:03 +0200

At 14.54 18/06/04 +0100, you wrote:
That's a pretty lousy solution. Here's a better one:

program cnumlist, rclass
        version 8.2
        numlist `0'
        local result "`r(numlist)'"
        local result : subinstr local result " " ",", all
        return local numlist "`result'"
end

i.e. this should take the same input as -numlist-.

Very little testing!
I think this could be great.
Many thanks prof Cox.

Enzo




Nick
[email protected]

> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]On Behalf Of Nick Cox

> While I agree on this, see -cseplist- in -listutil- on SSC,
> as one of several possible solutions.
>
> Enzo Coviello
>
> > I would find useful if -numlist could return, as option,  a
> > comma separated
> > numeric list.
> > There is some Stata function, i.e. -recode -inlist, that
> > needs as input a
> > comma separated list.
> > So we could feed them directly with the r(numlist) output.
> >
> > I wonder if other Users would find useful this addition.

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index