Learn R Programming

RJafroc (version 2.0.1)

DfReadDataFile: Read a data file

Description

Read a disk file and create a dataset object from it.

Usage

DfReadDataFile(
  fileName,
  format = "JAFROC",
  newExcelFileFormat = FALSE,
  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 in the file. It can be "JAFROC", the default, which requires a .xlsx Excel file, not .xls, "MRMC" or "iMRMC".

newExcelFileFormat

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.

delimiter

The string delimiter to be used for the "MRMC" format ("," is the default). 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


# \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