wdat(Rwinsteps)
wdat()所属R语言包:Rwinsteps
Winsteps Data File
Winsteps数据文件
译者:生物统计家园网 机器人LoveR
描述----------Description----------
These functions read and write Winsteps data files, where formatting is specified in a command file object.
这些功能的读取和写入Winsteps,数据文件,在格式中指定的命令文件对象。
用法----------Usage----------
write.wdat(x, cmd, datfile = cmd$data, na = " ")
read.wdat(cmd, datfile = cmd$data, na = " ", ilabels = NULL)
参数----------Arguments----------
参数:x
data frame of item responses
数据框的项目反应
参数:cmd
command file object
命令文件对象
参数:datfile
path to which the data file will be written, or from which it will be read, defaulting to the path supplied in the command file
将被写入数据文件,或从它将会读取在命令文件中提供的路径,默认的路径
参数:na
character representing missing data, defaulting to a blank space
字符代表丢失的数据,默认为一个空格
参数:ilabels
vector of new item labels to be added to the item columns, overriding cmd$labels
矢量新项目标签被添加到该项目的列,覆盖CMD $标签
Details
详细信息----------Details----------
When reading data, the person names should occupy 1 column and each item should occupy 1 column in the file. A warning is returned if any rows have fewer than the maximum number of columns and the person names are not in the last column, in which case the missing information pertains to items. ilabels will override the item labels in cmd$labels, if they exist. If both are NULL, generic item names are supplied.
读取数据时,人的名称应占据1列,每个项目应在文件中占据1列。返回一个警告,如果任何行的最大列数不到的人的名字是不是在最后一列,在这种情况下,丢失的信息与项目。 ilabels将覆盖该项目在cmd$labels的标签,如果它们的存在。如果是NULL,提供通用项目名称。
When writing data, all unnamed columns are assumed to be item responses. If the command file contains item labels they will be used to extract and reorder the item responses from x and all other columns in x will be ignored, except for the person IDs which must have a column name of "name". The data are written to the filename datfile in fixed width format according to the item1, ni, name1, and namelen command file components.
当写入数据时,所有未命名的列都被假定为项目反应。如果该命令文件包含项目标签,它们将被用于提取和重新排序的项目响应x和所有其他列在x将被忽略,除了人的ID必须有一个列名"name"。被写入的文件名datfile的固定宽度格式的数据根据item1,ni,name1和namelen命令文件组件。
值----------Value----------
read.wdat returns a data frame
read.wdat返回一个数据框
(作者)----------Author(s)----------
Anthony Albano <a href="mailto:tony.d.albano@gmail.com">tony.d.albano@gmail.com</a>
实例----------Examples----------
# Simulate data, with missings[模拟数据,missings]
set.seed(82911)
b <- seq(-3, 3, length = 15)
theta <- rnorm(100, 1)
rmat <- ifelse(rirf(b, theta)$p > runif(1500), 1, 0)
rmat[sample(1500, 30)] <- NA
rmat <- data.frame(rmat)
# Item and person labels[项目和人的标签]
colnames(rmat) <- paste("i", 1:15, sep = "")
rmat$name <- paste("p", 1:100, sep = "")
# Create command file[创建命令文件]
tempdat <- tempfile()
cmd <- wcmd(title = "R2Winsteps Example", data = tempdat,
item1 = 1, ni = 15, name1 = 16, namelen = 5,
labels = paste("i", 1:15, sep = ""), hlines = "Y")
# Write to temp file and read back in[写临时文件,读回]
write.wdat(rmat, cmd, na = "N")
rmat2 <- read.wdat(cmd, na = "N")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|