Dear Brigid,
cat() prints by default to standard output and invisibly returns NULL, which
print() prints. I think that what you want is
cat("Input criteria do not meet specifications. Check input against the
following requirements:
a >= 0
b <= 0
c >= 0 \n")
I hope this helps,
John
------------------------------
John Fox, Professor
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
web: socserv.mcmaster.ca/jfox
> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
On
> Behalf Of Brigid Mooney
> Sent: December-18-08 4:22 PM
> To: [email protected]
> Subject: [R] formatting print statements with multiple lines
>
> 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]]
>
> ______________________________________________
> [email protected] 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.
______________________________________________
[email protected] 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.