View source: R/loading_files.R
readVarFile | R Documentation |
Read variable values matrix
readVarFile(fileName, path = NULL, dec = ".", sep = NULL, check.names = TRUE)
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. |
a dataframe containing only the numeric columns of selected file. Each column is considered as a variable and each row as a sample.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.