Learn R Programming

kstIO (version 0.4-3)

read_kstructure: Read a knowledge structure file

Description

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

Usage

read_kstructure(filename, format = "auto", as.letters = TRUE)

Value

A list with the following elements:

matrix

the read structure/data as binary matrix

sets

the read structure as object of class kstructure.

Arguments

filename

A character string specifying the name of the structure file.

format

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

as.letters

logical, should the elements of the sets be letters or numbers?

Author

Cord Hockemeyer cord.hockemeyer@uni-graz.at

Details

The format values "SRBT", "KST", 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 thje read_XXX function.

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

References

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

Poetzi, S. & Wesiak, G. (2001). SRbT Tools User Manual. https://resources.cord-hockemeyer.info/techreports/SRBT-Tools_TechRep_FWF01.pdf

See Also

kstructure, kstIO-package

Examples

Run this code
# Produce a structure file
library(kst)
d <- getwd()
setwd(tempdir())
data(DoignonFalmagne7)
kst <- kstructure(as.pattern(DoignonFalmagne7$K, as.set=TRUE))
write_kstructure(kst, "DF7.struct") # Write in (default) SRBT format
# Read file
read_kstructure("DF7.struct") # Automatic format detection (default)
read_kstructure("DF7.struct", "SRBT") # Explicit format specification
setwd(d)

Run the code above in your browser using DataLab