Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: how does insheet determine datatypes?


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: how does insheet determine datatypes?
Date   Mon, 8 Jan 2007 09:09:58 -0000

This rings a very faint bell, but no precise command name 
springs to mind. 

Nick 
[email protected] 

Phil Schumm
 
> On Jan 7, 2007, at 12:09 PM, Nick Cox wrote:
> > This particular problem can be avoided by using -capture- 
> as a prefix.
> >
> > capture ren `var' `=`var'[1]'
> >
> > will eat the error if the first value is not a valid new variable  
> > name. Alternatively you could use -confirm- directly.
> 
> 
> Thanks for pointing that out -- I should have written the example  
> that way.  Production code would of course need this even with a  
> function to generate Stata names, to account for the possibility of  
> duplicate names (either because of duplicate names in the data file  
> or because a name in the file clashes with one of the 
> automatic names  
> Stata generates when -nonames- is used (i.e., v1, v2, ...)).
> 
> I gather from your response that you are unaware of an exposed  
> function to generate Stata names from an existing string?

*
*   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