Re: [R] Difference between console output of cat and print

2017-04-17 Thread Bert Gunter
Well,... cat() is as Jeff describes. However, print() is a generic function (see ?UseMethod) for which there are literally hundreds of different methods that may do far more/different than merely output character strings. For example, the print method for trellis objects, print.trellis, draws a

Re: [R] Difference between console output of cat and print

2017-04-17 Thread Jeff Newmiller
Please stop posting html email per the Posting Guide. You are only going to reduce the chance of successfully communicating your questions to experienced users on this list. Re cat vs print: the purpose of print is to show values much as they are entered in source code, so quotes and escaped

[R] Difference between console output of cat and print

2017-04-17 Thread Data MagicPro
Since both *cat * as well as * print * create a character vector for outputing on the screen. Still both give different results as apparant below. My query is why so ? > cat(10) 10 > print(10) [1] 10 Why is the [1] of index number missing in case of *cat *? Thanks Ramnik [[alternative