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

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


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: could numlist return a comma separated list?
Date   Fri, 18 Jun 2004 14:54:12 +0100

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! 

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/



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