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.
--
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907
______________________________________________
[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