Description Usage Arguments Value Examples
Read a csv file
1 2 3 4 5 6 7 8 9 10 |
file.path |
Name of input file |
sep |
Field separator. Default ; |
max.n.factor |
maximum number of column characters to be a factor. Default 3. |
header |
a logical value indicating whether the file contains the names of the variables as its first line. Default FALSE. |
row.names |
a vector of row names. Default NULL. |
col.names |
a vector of col names. Default NULL. |
n.rows |
integer: the maximum number of rows to read in. In case of Header = TRUE, it does not count for the number of read lines. |
transpose |
If TRUE, transpose the result. Default FALSE. |
A data frame containing a representation of the data in the file.
1 2 3 4 5 6 7 8 9 10 11 12 | df = data.frame("V1" = 1:5, "V2" = c("a", "b", "c", "d", "e"), "V3" = c("alto", "bajo", "bajo", "alto", "alto"))
write.df(df, "bench1.txt")
read.df(file.path = "bench1.txt")
write.df(df, "bench2.txt", header = TRUE)
read.df(file.path = "bench2.txt", header = TRUE)
write.df(df, "bench2.txt", append = TRUE)
read.df(file.path = "bench2.txt", header = FALSE)
write.df(df, "bench2.txt", sep = ";", header = FALSE, append = TRUE)
read.df(file.path = "bench2.txt", sep = ";", header = TRUE, max.n.factor = 3, row.names = c('X1', 'X2', 'X3', 'X4', 'X5'), col.names = c('A', 'B', 'C'), n.rows = 5, transpose = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.