doLabels: Class vector of data table

Description Usage Arguments Value Examples

View source: R/loading_files.R

Description

Class vector of data table

Usage

1
doLabels(fileName, factorName = NULL, classes = NULL, dec = ".", sep = ";")

Arguments

fileName

the name of the file which the data are to be read from. Each row of the table appears as one line of the file. If it does not contain an absolute path, the file name is relative to the current working directory, getwd().

factorName

string indicating the column name used to determine the labels of each row of matrix data. The NULL (default) indicates that the first column will be used.

classes

a vector of strings indicating which labels of choosed column will be compared, the minimum are two labels. The NULL (default) indicates that all classes will be compared.

dec

the character used in the file for decimal points.

sep

the field separator character. Values on each line of the file are separated by this character. If sep = "" the separator is white space, that is one or more spaces, tabs, newlines or carriage returns, if sep=NULL (default), the function uses tabulation for .txt files or ";" for .csv files.

Value

a vector that identify each row of the readVarFile object as a sample belonging to a state (network).

Examples

1
2
3
4
5
6
7
8
9
# Glioma file
gliomaData <- system.file("extdata", "variablesValue_BioNetStat_tutorial_data.csv", package = "BioNetStat")
labels<-doLabels(gliomaData)

# Random file
test1 <- as.data.frame(cbind(rep(LETTERS[1:4],each=10),matrix(rnorm(120),40,30)))
tfl<-tempfile(fileext = ".csv")
write.table(test1, tfl,sep=";",row.names=FALSE)
labels<-doLabels(tfl)

BioNetStat documentation built on Feb. 3, 2021, 2:01 a.m.