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."
cat(out, '\n') On Thu, Jun 17, 2010 at 10:19 AM, Adolf STIPS <adolf.stips at jrc.ec.europa.eu> wrote:> > 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. >-- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve?
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> xThis 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.
Seemingly Similar Threads
- Help asked for automated generation of ncdf variables
- Confidence intervals of gls function?
- Strange behavior when using progress bar (Fwd: Re: [R] The code itself disappears after starting to execute the for loop)
- Strange behavior when using progress bar (Fwd: Re: [R] The code itself disappears after starting to execute the for loop)
- limitations to random number generator in 64-bits machines