s-news
[Top] [All Lists]

Re: setting indices to true or false

To: "Leeds, Mark" <mleeds@mlp.com>
Subject: Re: setting indices to true or false
From: Tony Plate <tplate@blackmesacapital.com>
Date: Wed, 29 Jun 2005 09:42:50 -0600
Cc: s-news@lists.biostat.wustl.edu
In-reply-to: <54668D97C0199943A454516A5FF6481E010B3843@EXCHUS001.AD.MLP.COM>
References: <54668D97C0199943A454516A5FF6481E010B3843@EXCHUS001.AD.MLP.COM>
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
I noted that your question had already been answered, but it's also worth pointing out once in a while that it is not a good idea to use the underscore "_" as an assignment operator (use "<-" instead). The help for "<-" in S-PLUS 6.2 states:

> Because the underscore _ is an S-PLUS assignment operator,
> it is extremely important to remember it cannot be used in
> function and object names, unlike in many other languages.
> It is also deprecated as an assignment operator, so it may
> not be supported in future releases of S-PLUS.

Reputedly, the original reason that the underscore was an assignment operator was that that ascii code was actually a left arrow on the Bell labs teletypewriters where S was first developed. That would imply that no one ever intended usage that was so confusing & inconsistent wrt other computer languages.

-- Tony Plate

Leeds, Mark wrote:
I have a vector of trues and falses

Called longentryindex and I want to set some of them

myself but I can’t find the syntax

In any book and I have three of them.

Would it be Longentryindex[3]_F

Or

Longentryindex[3]_FALSE

Or  something like

Longentryindex[3]_(1 == 0 )



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