A convenience function to read data from specially structured file directly
into a CMData
object. There are two basic data format options: either the counts of responses of all categories are given (and the
cluster size is the sum of these counts), or the total cluster size is given with the counts of all but one category.
The first column should always give the treatment group, then either the counts for each category (first option, chosen by setting
with.clustersize = FALSE
), or the size of the cluster followed by the counts for all but one category (second option,
chosen by setting with.clustersize = TRUE
). Optionally, a last column could
give the number of times the given combination occurs in the data.
read.CMData(file, with.clustersize = TRUE, with.freq = TRUE, ...)
a CMData
object
name of file with data. The data in the file should be structured as described above.
logical indicator of whether a cluster size variable is present in the file
logical indicator of whether a frequency variable is present in the file
additional arguments passed to read.table
Aniko Szabo
CMData