batch.pfile: Batch Read Winsteps Person Files (pfile) Into R

Description Usage Arguments Value

View source: R/batchPfile.r

Description

This function looks at a directory, identifies all the pfiles in the directory based on a common string pattern, and returns a list with all person files (i.e., each element of the list represents a different pfile). Alternatively, a string vector of files to read in can be supplied. Note that this function assumes standard .txt files. For more information on Winsteps item files, see http://www.winsteps.com/winman/pfile.htm.

Usage

1
2
3
4
5
6
batch.pfile(demNameL = NULL, dir = getwd(), files = NULL, pat = "Pfile",
  r2WinstepsFile = TRUE, varWidths = c(1, 5, 8, 3, 8, 9, 7, 7, 7, 7, 7, 7,
  7, 7, 6, 6, 6, 6, 8), pFileNames = c("Dropped", "Entry", "Theta", "Status",
  "Count", "RawScore", "SE", "Infit", "Infit_Z", "Outfit", "Outfit_Z",
  "Displacement", "PointMeasureCorr", "Weight", "ObservMatch", "ExpectMatch",
  "PointMeasureExpected", "RMSR", "WMLE"))

Arguments

demNameL

Optional list containing the names of the demographic variables for pfiles. Must equal the number of demographic fields being read into R.

dir

Directory where pfiles are saved. Defaults to current working directory.

files

Optional character vector of the names of the person files to be read into R. Note that only the names of the files (not the extension) are neccessary. The function assumes .txt files.

pat

A common character string in all item files. Only used if files = NULL, Defaults to "Pfile", which is what is automatically generated when link{r2Winsteps} is called.

r2WinstepsFile

Logical. Was the link{r2Winsteps} function called to produce the person files? Defaults to TRUE. Note that if FALSE all demographic variables will be read into a single variable.

varWidths

Width of the person file columns. These widths correspond to all but the final person demographic columns. If you are using the current version of Winsteps, and have not requested any additional columns be represented in the item file, these shouldn't need to be changed. Older versions of Winsteps (e.g., 3.6.8) may need the following widths c(1, 5, 8, 3, 8, 9, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6). Note that the first width of 1 is included to parse comments from item files (e.g., extreme scores). This column is dropped because it is redundant and also represented in the status column.

pFileNames

The column names for the person files being read in. These correspond to the names of all but the person variable names. Note that the length(pFileNames) must equal length(varWidths). The pFileNames can be changed for personal preference or to accomodate older versions of Winsteps. For example, version 3.6.8 names might be c("Dropped", "Entry", "Theta", "Status", "Count", "RawScore", "SE", "Infit", "Infit_Z", "Outfit", "Outfit_Z", "Displacement", "PointMeasureCorr", "Weight", "ObservMatch", "ExpectMatch").

Value

List of person files, with each element of the list representing a separate person file.


DJAnderson07/r2Winsteps documentation built on Sept. 12, 2019, 1:06 a.m.