Skip to content
Back to formatted view

Raw Message

Message-ID: <494AC10E.9080308@gmx.de>
Date: 2008-12-18T21:30:54Z
From: Stephan Kolassa
Subject: formatting print statements with multiple lines
In-Reply-To: <85f3856f0812181322k44f8db60kdcddd0a30d7b94a7@mail.gmail.com>

Use cat() with "\n" for newlines and "\t" for tabs,

cat("Input criteria does not meet specifications.  Check input against 
the following requirements:\n\ta >= 0\n\t")

HTH,
Stephan


Brigid Mooney schrieb:
> When executing the command:
> 
>     print(cat(paste("Input criteria does not meet specifications.  Check
> input against the following requirements:
>             a >= 0
>             b <= 0
>             c >= 0 ", sep=""), ""))
> 
> I get:
> Input criteria does not meet specifications.  Check input against the
> following requirements:
>             a >= 0
>             b <= 0
>             c >= 0  NULL
> (with that extra NULL at the end).
> 
> If I omit the 'cat' command, the NULL goes away, but I no longer get the
> next-line formatting that I want.
> 
> I think I'm missing something about one of these functions returning a NULL
> value, but I can't seem to get the exact result I want (no NULL value, and
> keep the next-line formatting.)
> 
> Any ideas or suggestions are much appreciated.
> 
> Thanks!
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> 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.
>