| read_kdata | R Documentation |
Read a set of response patterns from a file. The file formats are described in the kstIO-package information page.
read_kdata(filename,
format = "auto",
as.letters = TRUE,
header = TRUE,
sep = ',')
filename |
A character string specifying the name of the data 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? |
header |
For spreadsheet files only: does the file contain a header row? |
sep |
For CSV files only: character separating cells within a row. |
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 item names are letters,
otherwise numbers. If the data are read from a spreadsheet file (CSV, XLSX, or ODS)
containing a header row, item names are taken from there. If they are read from
a spreadsheet file without header, the reading function automatically assigns
item names from "V1" to "Vn" where n is the number of items.
A binary matrix with the response patterns.
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
kstIO-package
# Produce a data file
d <- getwd()
setwd(tempdir())
space <- kmunionclosure(phsg$basis)
data <- kmsimulate(space, 10, 0.1, 0.05)
write_kdata(data, "phsg.ods", "ODS") # matrix format (without any headers)
# Read file; only the first ten rows of the matrix are printed by default
read_kdata("phsg.ods") # Automatic format detection (default)
data <- read_kdata("phsg.ods", "ODS") # Explicit format specification
data
dim(data)
setwd(d)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.