I have a dataset where I am training on to coerce as dataset (foundable in the onòy in SetMethods package)
library(QCA)
library(SetMethods)
data(SCHF)
# Get the truth table for the presence of the outcome:
TT_y <- truthTable(SCHF, outcome = "EXPORT",
conditions = c("EMP","BARGAIN","UNI","OCCUP","STOCK", "MA"),
incl.cut = .9,
complete = TRUE,
PRI = TRUE,
sort.by = c("out", "incl", "n"))
what I would like to to is to coerce this object into a dataset. This is my failing trial
table = as.data.table(TT_y)
table
Would you have some possible alternative? Thanks
We could extract the
ttdata frame directly from the object returned bytruthTable. We will, however, need to remove the rows wheren == 0to obtain what you're after.Output:
Data:
The data used here is the
Lipset binary crisp dataused in the first example in the documentation ofQCA::truthTable. I cannot find theSCHF-dataset.Update: I've found the dataset (and updated OP). Same approach, new filtering :-)
Output: