Description Usage Arguments Value Author(s) Examples
This function can be used to read a tab delimited text file to be used as input for the functions fcros(), fcros2(), fcrosMod() pfco() or pfcoMod(). You may also use other functions (read.csv(), read.csv2(), read.delim() or read.delim2()) to read your dataset.
1 | fcrosRead(filename)
|
filename |
"filename" is a tab delimited text file to read. The first line of this file should contain labels. |
Output is a matrix or a table containing data.
Doulaye Dembele, doulaye@igbmc.fr
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # generate random dataset of size 100 x 5
xdata <- matrix(c(rep(0,600)), ncol = 6);
xdata[,2:6] <- matrix(rnorm(500,0,1), ncol = 5);
x0 <- matrix(NA, 100, 0);
for (i in 1:100) {
x0[i] <- paste("Obs_",i, sep = "");
}
# set column names
colnames(xdata) <- c("Index", "Col_1", "Col_2", "Col_3", "Col_4", "Col_5");
# save data in a text file
write.table(xdata, file = "test2delete.txt", quote = FALSE, sep = "\t",
eol = "\n", col.names = TRUE, row.names = FALSE);
# now used fcros.read() to open the file
mydata <- fcrosRead(file = "test2delete.txt");
summary(mydata)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.