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: r(varlist)
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: r(varlist)
Date
Thu, 8 Nov 2012 17:14:43 +0000
-display- is two things bundled in one: a calculator and a command to
show results. Its built-in inclinaton, given variable (or any other)
names, is to evaluate them and show the result of evaluating them. To
get -display- to hold off evaluating things, supplying " " underlines
that you want to see strings, i.e. the names, not the result of
evaluating those names.
Nick
On Thu, Nov 8, 2012 at 4:33 PM, Maarten Buis <[email protected]> wrote:
> You'll get the same again if you type: di "`r(varlist)'".
>
> The logic behind what you saw is that
>
> di `r(varlist)'
>
> is like typing
>
> di make price mpg rep78 headroom trunk weight length turn displacement
> gear_ratio foreign
>
> Which means "display the content of the first observation of each of
> these variables".
>
> Hope this helps,
> Maarten
>
> On Thu, Nov 8, 2012 at 5:26 PM, tashi lama <[email protected]> wrote:
>> Hello all,
>> sysuse auto, clear
>> ds
>> return list
>>
>> macros:
>> r(varlist) : "make price mpg rep78 headroom trunk weight length turn displacement gear_ratio foreign"
>>
>> di r(varlist)
>> make price mpg rep78 headroom trunk weight length turn displacement gear_ratio foreign
>>
>> Since r(varlist) is a macro, do I not say
>> di `r(varlist)'
>> Surprisingly, when I say di `r(varlisr)' gives me AMC Concord40992232.5112930186401213.57999990
>>
>>
>> Am I missing something here??
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/