s-news
[Top] [All Lists]

Re: Splus returns NULL

To: Dennis Fisher <fisher@plessthan.com>
Subject: Re: Splus returns NULL
From: Patrick Burns <pburns@pburns.seanet.com>
Date: Fri, 19 Oct 2007 16:29:27 +0100
Cc: s-news@lists.biostat.wustl.edu
In-reply-to: <3DD44318-62C7-4AF0-9DB7-BD1D73E93070@plessthan.com>
References: <20071019102007.3EBCC127B7A@smtp.biostat.wustl.edu> <3DD44318-62C7-4AF0-9DB7-BD1D73E93070@plessthan.com>
User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
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
patrick@burns-stat.com
+44 (0)20 8525 0696
http://www.burns-stat.com
(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>