...
tt$truth <- tt$A & tt$B & tt$C
to evaluate the outcome of expand.grid.
or, as I said,
tt$truth <- apply(tt,1, all)
which works for any number of columns in tt.
Bert Gunter
"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berke
... Forgot to include for completeness: dat is as Jeff suggested:
both <- c(TRUE, FALSE)
dat <- expand.grid(both, both)
Bert Gunter
On Sat, Mar 12, 2022 at 10:33 AM Bert Gunter wrote:
>
> As Tim pointed out, your query is rather vague. A reprex would have
> really helped here: please include th
As Tim pointed out, your query is rather vague. A reprex would have
really helped here: please include them whenever possible in future
queries.
As Spencer said, a simple search would likely have yielded whatever
you were seeking. Do make such efforts before posting.
And as Jeff indicated, it's m
Please keep the list included in the thread using reply-all...
tt[,3:1] reverses the columns in tt. The expand.grid function cycles through
possible values most quickly in the first column, which is useful if you intend
to convert the result to a matrix, but is not conventional for truth tables.
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 wrote:
>Dear friends,
>
>Hope you are doing great. I have been searching for a truth table generator
>in R
library(sos)
tt <- findFn("{truth table}")
installPackages(tt)
tt
This just now opened two sheets in my default browser. The first
listed all the help pages in contributed packages with the phrase "truth
table", sorted to put first the ones in packages with the most matches.
The second i
6 matches
Mail list logo