Re: [R] Question regarding print

From: Greg Snow <Greg.Snow_at_imail.org>
Date: Thu, 17 Jun 2010 12:00:42 -0600

The cat function is probably the best approach, but if your really feel the need to use print then you can just assign blank names (now it will be a named vector and slower in heavy calculations, but the printing is different). Try something like:

> names(x) <- rep( '', length(x) )
> print(x)

# or
> x

This of course leads to the question of how to prevent the blank line(s). The best answer there is use the cat function (or some other specialized function to print your objects (which will probably use cat)).

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow_at_imail.org
801.408.8111



> -----Original Message-----
> From: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-
> project.org] On Behalf Of Adolf STIPS
> Sent: Thursday, June 17, 2010 8:20 AM
> To: r-help_at_r-project.org
> Subject: [R] Question regarding print
>
>
> Hi,
>
> Does anybody know how to have output from print, without the leading
> [1]?
> (Or must I use cat/write?)
>
> >out="r15"
> >print(out,quote=FALSE)
> [1] r15
>
> And I definitely do not want the leading [1] as I want to construct a
> table
> from this.
>
> Ciao, Adolf
>
>
>
>
> ------------------------------------------------
> Adolf Stips (new email: adolf.stips_at_jrc.ec.europa.eu)
> Global Environment Monitoring unit
> CEC Joint Research Centre, TP 272
> I-21027 Ispra, Italy
> Tel: +39-0332-789876
> Fax: +39-0332-789034
> I know that I do not know, but even that not for sure!
> ------------------------------------------------
> "The views expressed are purely those of the writer and may not in any
> circumstances be regarded as stating an official position of the
> European
> Commission."
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Received on Thu 17 Jun 2010 - 18:03:12 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 17 Jun 2010 - 18:30:32 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive