readVarFile: Read variable values matrix

Description Usage Arguments Value Examples

View source: R/loading_files.R

Description

Read variable values matrix

Usage

1
readVarFile(fileName, path = NULL, dec = ".", sep = NULL, check.names = TRUE)

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().

path

the path to the directory that contains the file. Used only by Graphical Interface.

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.

check.names

a logical value. If TRUE, the names of the data table kept as they are. Otherwise, the blank space, "-","/" and ",", are replaced by dots.

Value

a dataframe containing only the numeric columns of selected file. Each column is considered as a variable and each row as a sample.

Examples

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

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

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