On 4 Jan 2005, Peter Dalgaard wrote:
>Dan Bolser <[EMAIL PROTECTED]> writes:
>
>> I am trying the following code...
>>
>> for(i in 1:bins){
>> print(cat(c(i, length(var1[var1==i]))))
>> }
>>
>> Where var1 is a vector with zero or more values = {1, 2, ..., bins} (or
>> something like that).
>>
>> The result I get is...
>>
>> 1 33NULL
>> 2 28NULL
>............
>> 19 0NULL
>> 20 3NULL
>>
>> I don't know what I am doing to get those stray NULL characters printed.
>
>You're printing them, will you believe it...?
>
>Consider this:
>
>> x <- cat("abc")
>abc> print(x)
>NULL
>> x
>NULL
>> print(cat("abc"))
>abcNULL
>
>I.e. cat() always returns NULL, invisibly unless you force it to be
>printed.
never trust a cat!
>
>
>
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html