Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.OSF.4.58.0508111137250.191916@odin.mdacc.tmc.edu>
Date: 2005-08-11T16:42:57Z
From: Paul Roebuck
Subject: question on creating a new logical variable
In-Reply-To: <f7dc8e940508110857320c9b3d@mail.gmail.com>

On Thu, 11 Aug 2005, Renuka Sane wrote:

> I have two variables.
> A <- rep(c(1:9), 2)
> B <- rep(c(2:10),2)
>
> I want to know the the value for
> A==1 and B==1
>
> [SNIP]
>
> To solve the problem I therefore create a new variable
> C <- c(A, B)
> and then do table(C==1) which gives me
> FALSE TRUE
> 34 2
>
> Is there a way to do this without making the new variable C?

You mean something besides not explicitly creating it?

table(c(A, B) == 1)

----------------------------------------------------------
SIGSIG -- signature too long (core dumped)