| read_data_csv | R Documentation |
Imports a numeric data table from a CSV file and converts it to the internal matrix structure used by the package.
read_data_csv(
filename,
format = "row",
header.col = TRUE,
header.row = TRUE,
sep = ","
)
filename |
Path to the CSV file containing the data matrix. |
format |
Data layout format, either |
header.col |
Logical; whether the file has a header row. |
header.row |
Logical; whether the file has a row names column. |
sep |
Field separator used in the file. |
A numeric matrix containing the imported data in the package's
internal orientation, with variables in rows and samples in columns.
If format = "row", the input table is transposed before being
returned. The function stops with an error if non-numeric values are found
in the data table.
data_file <- tempfile(fileext = ".csv")
data_in <- data.frame(
x1 = c(1.1, 2.2, 3.3),
x2 = c(4.4, 5.5, 6.6),
row.names = c("s1", "s2", "s3")
)
utils::write.csv(data_in, data_file)
read_data_csv(data_file, format = "row", header.row = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.