Read a surmise relation from a file. The file formats are described in the kstIO-package information page.

read_surmiserelation(filename, format = "auto", as.letters = TRUE, close = FALSE)

Arguments

filename

A character string specifying the name of the base file.

format

Specification of the files format. Can be "SRBT", "matrix", or "auto" (default).

as.letters

logical, should the elements of the sets be letters or numbers? Defaults to TRUE.

close

logical, should the relation be closed under reflexivity and transitivity? Defaults to FALSE

Details

The format values "SRBT" and "matrix" refer to the different generations of file formats described in kstIO-package. The value "auto" (default) requests an automatic detection of the format by the read_XXX function.

If as.letters is TRUE (default), the elements of the sets are letters, otherwise numbers.

If close is TRUE (default is FALSE), the relation is closed under reflexivity and transitivity, otherwise it is returned as is.

Value

A list with two elements:

relation

The surmise relation as object of class relation.

matrix

The incidence matrix of the surmise relation.

References

Hockemeyer, C. (2001). KST Tools User Manual (2nd ed.). https://kst.hockemeyer.at/techreports/KST-Tools_TechRep_FWF01.pdf.

Poetzi, S. \& Wesiak, G. (2001). SRbT Tools User Manual. https://kst.hockemeyer.at/techreports/SRBT-Tools_TechRep_FWF01.pdf

Author

Cord Hockemeyer cord.hockemeyer@uni-graz.at

See also

Examples

# Produce a relation file library(kst) d <- getwd() setwd(tempdir()) data(DoignonFalmagne7) r <- as.relation(kspace(kstructure(as.pattern(DoignonFalmagne7$K, as.set=TRUE)))) write_surmiserelation(r, "DF7.rel", "SRBT") # SRBT format # Read file read_surmiserelation("DF7.rel") # Automatic format detection
#> $relation #> A binary relation of size 5 x 5. #> #> $matrix #> a b c d e #> a 1 0 1 1 1 #> b 0 1 1 1 1 #> c 0 0 1 0 1 #> d 0 0 0 1 0 #> e 0 0 0 0 1 #>
read_surmiserelation("DF7.rel", "SRBT") # Explicit format specification
#> $relation #> A binary relation of size 5 x 5. #> #> $matrix #> a b c d e #> a 1 0 1 1 1 #> b 0 1 1 1 1 #> c 0 0 1 0 1 #> d 0 0 0 1 0 #> e 0 0 0 0 1 #>
setwd(d)