load_data {combiroc}R Documentation

Load CombiROC data.

Description

A customized read.table() function that checks the conformity of the dataset format, and only if all checks are passed, loads it.

Usage

load_data(data, sep = ";", na.strings = "", labelled_data = TRUE)

Arguments

data

the name of the file which the data are to be read from.

sep

the field separator character.

na.strings

a character vector of strings which are to be interpreted as NA values.

labelled_data

a boolean that specifies whether the combiroc data to be loaded is labelled (with 'Class' column) or not.

Details

The dataset to be analysed should be in text format, which can be comma, tab or semicolon separated:

Value

a data frame (data.frame) containing a representation of the data in the file.

Examples

## Not run: 
demo_data # combiroc built-in demo data (proteomics data from Zingaretti et al. 2012 - PMC3518104)

# save a data.frame as a csv to be load by combiroc package
file<- tempfile()
write.csv2(demo_data, file = file, row.names = FALSE)


#To load a csv file if correctly formatted

demo_data <- load_data(data = file, sep = ';', na.strings = "")


demo_unclassified_data # combiroc built-in unclassified demo data

# save a data.frame as a csv to be load by combiroc package
file<- tempfile()
write.csv2(demo_unclassified_data, file = file, row.names = FALSE)

# To load an unclassified dataset.

demo_unclassified_data <- load_data(data = file, sep = ';', na.strings = "", labelled_data = FALSE)

## End(Not run)

[Package combiroc version 0.3.4 Index]