| read_kstructure | R Documentation |
Read a knowledge structure from a file. The file formats are described in the kstIO-package information page.
read_kstructure(filename,
format = "auto",
as.letters = TRUE,
header = TRUE,
sep = ',',
enforce = TRUE
)
filename |
A character string specifying the name of the structure file. |
format |
Specification of the files format. Can be "SRBT", "KST", "matrix", "CSV", "ODS", "XLSX", or "auto" (default). |
as.letters |
logical, should the elements of the sets be letters or numbers? |
header |
For spreadsheet format: Does the file include a header? |
sep |
Cell separator for CSV files. |
enforce |
Do we enforce that the resulting structure is a knowldge structure or do we trust the file's correctness? |
The format values "SRBT", "KST", and
"matrix" refer to the different generations of file formats
described in kstIO-package. "CSV", "ODS", and "XLSX"
refer to the repsective spreadsheet formats. 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.
A list with the following elements:
matrix |
the read structure/data as binary matrix |
sets |
the read structure as object of class |
In automatic format detection, the distinction between "matrix"
and "KST" formats work somewhat heuristic. In other words, in rare
cases the automatic detection might give the wrong result.
Cord Hockemeyer cord.hockemeyer@uni-graz.at
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
kstructure,
kstIO-package
# Produce a structure file
d <- getwd()
setwd(tempdir())
kst <- kmstructure(phsg$basis)
write_kstructure(kst, "phsg.struct") # Write in (default) SRBT format
write_kstructure(kst, "phsg_struct.ods") # write in ODS format
# Read file
read_kstructure("phsg.struct") # Automatic format detection by heuristics (default)
read_kstructure("phsg_struct.ods") # Automatic format detection by filename extension
setwd(d)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.