print.cna: 'print' method for objects of class "cna"

View source: R/print.cna.r

print.cnaR Documentation

print method for objects of class “cna”

Description

The print method for objects of class “cna” prints the results of a Coincidence Analysis stored in x, by default the top five asf and csf.

Usage

## S3 method for class 'cna'
print(x, what = x$what, digits = 3, nsolutions = 5, 
      printMeasures = TRUE, details = x$details, 
      show.cases = NULL, verbose = FALSE, ...)

Arguments

x

Object of class “cna”.

what

Character string specifying what to print; "t" for the configuration table, "m" for msc, "a" for asf, "c" for csf, and "all" for all. Defaults to the setting stored in x, which is "ac" unless suff.only = TRUE in the cna call that generated x, in which case it is "m".

digits

Number of digits to print in evaluation measures (e.g. consistency and coverage) as well as in exhaustiveness, faithfulness, and coherence scores.

nsolutions

Maximum number of msc, asf, and csf to print. Alternatively, nsolutions = "all" prints all solutions.

printMeasures

Logical; if TRUE, the output indicates which measures for sufficiency and necessity evaluation were used.

details

Character vector specifying the evaluation measures and additional solution attributes to be printed. Possible elements are all the measures in showMeasures. Can also be TRUE/FALSE. Defaults to the details specification stored in x. If FALSE, no additional measures are printed; TRUE resolves to c("inus", "cyclic", "fm_empirical","fm_structural", "exhaustiveness", "faithfulness",
"coherence"), of which fm_empirical and fm_structural are printed only for csf. See also detailMeasures.

show.cases

Logical; if TRUE, the attribute “cases” of the analyzed configTable is printed (see print.configTable).

verbose

Logical; passed to csf. If TRUE, each step of the csf building process is reported along with the number of csf it yields, e.g. the number of initial csf and the number of csf retained after the elimination of structurally or functionally redundant solutions. Has no effect if no csf are built, that is, if what does not contain “c”. FALSE by default.

...

Arguments passed to other print-methods.

Details

By default, the method print.cna first lists the factors or, if a causal ordering was specified, the ordering, as well as the pre-specified outcome(s) (if any). Second, it shows the measures con and cov used for model building. Third, the top 5 asf and, fourth, the top 5 csf are reported, with a note on the total number of solutions whenever not all of them are printed. To print all msc, asf, and csf, the value of nsolutions can be suitably increased, or the functions in cna-solutions can be used.

While msc and asf are stored in the output object of cna, csf are not. The latter are derived from the inventory of asf at execution time (by running the function csf) whenever a “cna” object is printed. That call uses the settings stored in x: func.minimal.only, acyclic.only, cycle.type, inus.only and inus.def (see csf and cnaControl). Hence, if the cna call that produced x used func.minimal.only = TRUE, only functionally minimal csf are printed; if it used acyclic.only = TRUE, no csf containing a cyclic substructure are printed.

The argument what regulates what items of the output of cna are printed. If the string assigned to what contains the character “t”, the configuration table is printed; if it contains an “m”, the msc are printed; if it contains an “a”, the asf are printed; if it contains a “c”, the csf are printed. what = "all" and what = "tmac" print all output items.

The argument digits determines how many digits of the evaluation measures and solution attributes are printed, while nsolutions fixes the number of msc, asf, and csf to print.
nsolutions applies separately to minimally sufficient conditions, atomic solution formulas, and complex solution formulas. nsolutions = "all" prints all minimally sufficient conditions, atomic and complex solution formulas. show.cases applies if what includes “t”. In that case, show.cases = TRUE yields a configuration table featuring a “cases” column, which assigns cases to configurations.

The option spaces controls how the conditions are rendered. The current setting is queried by typing getOption("spaces"). The option specifies characters that will be printed with a space before and after them. The default is c("<->","->","+"). A more compact output is obtained with options(spaces = NULL).

See Also

cna, csf, cna-solutions, detailMeasures, showMeasures, func_minim

Examples

# Analysis of crisp-set data.
cna.educate <- cna(d.educate)
cna.educate
# Print only complex solution formulas.
print(cna.educate, what = "c")
# Print only atomic solution formulas.
print(cna.educate, what = "a")
# Print only minimally sufficient conditions.
print(cna.educate, what = "m")
# Print only the configuration table.
print(cna.educate, what = "t")
# Print solutions with spaces before and after "*".
options(spaces = c("<->", "->", "*"))
cna(d.educate, details = c("ex", "fa", "PAcon", "PACcov"))
# Restore the default of the option "spaces".
options(spaces = c("<->", "->", "+"))

# Analysis of multi-value data.
cna.pban <- cna(d.pban, outcome = "PB=1", cov = .95, maxstep = c(6, 6, 10), 
								what = "all")
cna.pban
# Print only the atomic solution formulas.
print(cna.pban, what = "a", nsolutions = "all")
# Do not print the specification of the evaluation measures.
print(cna.pban, what = "a", nsolutions = "all", printMeasures = FALSE)
# Print further details.
print(cna.pban, nsolutions = "all", details = c("AACcon", "AAcov", "ex", "fa"))
# Print more digits.
print(cna.pban, nsolutions = "all", digits = 6)
# Print the configuration table with the "cases" column.
print(cna.pban, what = "t", show.cases = TRUE, printMeasures = FALSE)

# The settings stored in the object also govern csf(): this analysis
# retains only functionally minimal csf.
cna.pban.fm <- cna(d.pban, outcome = "PB=1", cov = .95, maxstep = c(6, 6, 10),
                   func.minimal.only = TRUE)
csf(cna.pban.fm)

cna documentation built on Oct. 28, 2026, 9:07 a.m.