Skip to content
Prev 390984 / 398506 Next

Is there a Truth Table Generator in R?

To the end of Jeff's program add
tt$truth <- tt$A & tt$B & tt$C
to evaluate the outcome of expand.grid. 

Tim

-----Original Message-----
From: R-help <r-help-bounces at r-project.org> On Behalf Of Jeff Newmiller
Sent: Saturday, March 12, 2022 12:05 PM
To: r-help at r-project.org; Paul Bernal <paulbernal07 at gmail.com>; R <r-help at r-project.org>
Subject: Re: [R] Is there a Truth Table Generator in R?

[External Email]

both <- c( FALSE, TRUE )
tt <- expand.grid( C = both
                 , B = both
                 , A = both
                 )
tt <- tt[, 3:1 ]
On March 12, 2022 8:42:28 AM PST, Paul Bernal <paulbernal07 at gmail.com> wrote:
--
Sent from my phone. Please excuse my brevity.

______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dhelp&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAsRzsn7AkP-g&m=Cj0cRxlu_GS0ARzvxm-eD27PhuhkgT_azaq1hamiYDmCglHF8_9hGTAkcDNoZtUq&s=h0wdH7OvIxKWgjwFmBIGHvswAKy8VKwyyI3IbB9dKkc&e=
PLEASE do read the posting guide https://urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.org_posting-2Dguide.html&d=DwICAg&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAsRzsn7AkP-g&m=Cj0cRxlu_GS0ARzvxm-eD27PhuhkgT_azaq1hamiYDmCglHF8_9hGTAkcDNoZtUq&s=tsrpB1zmIQL_wMcn70xPEkvpaisBrAM9k2OQ8kDrebw&e=
and provide commented, minimal, self-contained, reproducible code.