Learn R Programming

RJafroc (version 2.1.2)

DfReadDataFile: Read a data file

Description

Read a disk file and create a ROC, FROC or LROC dataset object from it.

Usage

DfReadDataFile(
  fileName,
  format = "JAFROC",
  newExcelFileFormat = FALSE,
  lrocForcedMark = NA,
  delimiter = ",",
  sequentialNames = FALSE
)

Value

A dataset with the structure specified in RJafroc-package.

Arguments

fileName

A string specifying the name of the file. The file-extension must match the format specified below.

format

A string specifying the format of the data file. It can be "JAFROC", the default, which requires a .xlsx Excel file (not .xls), "MRMC" or "iMRMC". For "MRMC" the format is determined by the data file extension (.csv or .txt or .lrc) as specified in https://perception.lab.uiowa.edu/. For "iMRMC" the file extension is .imrmc and the format is described in https://code.google.com/archive/p/imrmc/. See following note for important information about deprecation of the "MRMC" format.

newExcelFileFormat

Logical. Must be true to read LROC data. This argument only applies to the "JAFROC" format. The default is FALSE. If TRUE the function accommodates 3 additional columns in the Truth worksheet. If FALSE, the original function (as in version 1.2.0) is used and the three extra columns, if present, throws an error.

lrocForcedMark

Logical: For LROC dataset only: is a forced mark required on every image? The default is NA. If a mark is not required, set it to FALSE otherwise to TRUE.

delimiter

The string delimiter to be used for the "MRMC" format ("," is the default), see https://perception.lab.uiowa.edu/. This parameter is not used when reading "JAFROC" or "iMRMC" data files.

sequentialNames

A logical variable: if TRUE, consecutive integers (starting from 1) will be used as the treatment and reader IDs (i.e., names). Otherwise, treatment and reader IDs in the original data file will be used.

Examples

Run this code
fileName <- system.file("extdata", "toyFiles/ROC/rocCr.xlsx", 
package = "RJafroc", mustWork = TRUE)
rdrArr1D <- DfReadDataFile(fileName, newExcelFileFormat = TRUE)


# \donttest{
fileName <- system.file("extdata", "Roc.xlsx", 
package = "RJafroc", mustWork = TRUE)
RocDataXlsx <- DfReadDataFile(fileName)

fileName <- system.file("extdata", "RocData.csv", 
package = "RJafroc", mustWork = TRUE)
RocDataCsv<- DfReadDataFile(fileName, format = "MRMC")

fileName <- system.file("extdata", "RocData.imrmc", 
package = "RJafroc", mustWork = TRUE)
RocDataImrmc<- DfReadDataFile(fileName, format = "iMRMC")

fileName <- system.file("extdata", "Froc.xlsx", 
package = "RJafroc", mustWork = TRUE)
FrocDataXlsx <- DfReadDataFile(fileName, sequentialNames = TRUE)
# }

Run the code above in your browser using DataLab