[R] Difference in Cat(...) function between S Plus and R ?

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Jan 9 19:33:12 CET 2002


Looks like it's a list, but you haven't told us (and the result of
typeof() would have helped).

If so, this is a known difference, and see ?unlist for how to help resolve
it.  I don't think though that what you show for `S Plus' is very useful,
and normally you want to loop over a list.

On Wed, 9 Jan 2002 Liu.Chunhua at epamail.epa.gov wrote:

> Dear All,
>
> THis is my "data.char$excluded" object and I want to show its content in
> my output screen.
>
> > data.char$excluded
> $names
> [1] "Species" "Target"  "Sex"
>
> [[2]]
> [1] "DG"
>
> [[3]]
> [1] "R"
>
> [[4]]
> [1] "M"
>
> >
>
> When I run cat() in S Plus, I got:
>
> > cat(data.char$excluded, "\n")
> c("Species", "Target", "Sex") "DG" "R" "M"
>
> However, when I run the same commend in R, I got:
> > cat(data.char$excluded, "\n")
> Error in cat(list(...), file, sep, fill, labels, append) :
>         argument 1 not yet handled by cat
>
> Anyone know what's wrong with it.
>
> Thanks
>
> Charlie Liu
>
>
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list