s-news
[Top] [All Lists]

Fwd: Splus returns NULL

To: s-news@lists.biostat.wustl.edu
Subject: Fwd: Splus returns NULL
From: Dennis Fisher <fisher@plessthan.com>
Date: Fri, 19 Oct 2007 08:52:16 -0700
References: <4718CD56.9030606@pburns.seanet.com>
Colleagues,

I thank you for the many replies to my query.  Of these, Patrick's (shown below) was the most efficient.

Dennis


Dennis Fisher MD

P < (The "P Less Than" Company)

Phone: 1-866-PLessThan (1-866-753-7784)

Fax: 1-415-564-2220

www.PLessThan.com


Begin forwarded message:

From: Patrick Burns <pburns@pburns.seanet.com>
Date: October 19, 2007 8:29:27 AM PDT
To: Dennis Fisher <fisher@plessthan.com>
Subject: Re: [S] Splus returns NULL

Actually R returns NULL as well, it merely
does so invisibly.  So if you are happy with
what R does, you can do:

if(!X) cat("hello") else invisible()

Patrick Burns
+44 (0)20 8525 0696
(home of S Poetry and "A Guide for the Unwilling S User")

Dennis Fisher wrote:

Colleagues

This is probably remarkably simple but I cannot find the answer.  When a conditional statement tests as negative, Splus (version 7.0.0 running on RedHat Linux) returns NULL.

for example:


X <- T
if (!X) cat("hello")

returns NULL.  I have tested options(warn=-1) and options(echo=F) to no avail.  In R, the same commands return nothing.

Any ideas how to prevent the NULL returns?

Dennis




Dennis Fisher MD

P < (The "P Less Than" Company)

Phone: 1-866-PLessThan (1-866-753-7784)

Fax: 1-415-564-2220

www.PLessThan.com







<Prev in Thread] Current Thread [Next in Thread>