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 <enzo.coviello@tin.it>
To   statalist@hsphsun2.harvard.edu
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
n.j.cox@durham.ac.uk

> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu]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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index