import2 {W4MRUtils} | R Documentation |
Import two W4M tables
Description
import2 Function to import a metadata table file and its corresponding dataMatrix file. import2 performs checks to ensure the identifiers match between the two tables and stops with an explicit error message in case identifiers do not match.
Usage
import2(pathDM, pathMeta, typeMeta, disable_comm = TRUE)
Arguments
pathDM |
a path to a file corresponding to the dataMatrix |
pathMeta |
a path to a file corresponding to the metadata table |
typeMeta |
"sample" or "variable" depending on the metadata content |
disable_comm |
a |
Value
a list
containing two elements:
dataMatrix a
data.frame
corresponding to the imported dataMatrix table;metadata a
data.frame
corresponding to the imported metadata table
Author(s)
M.Petera
Examples
dm_path <- system.file(
"extdata",
"mini_datamatrix.txt",
package="W4MRUtils"
)
meta_path <- system.file(
"extdata",
"mini_variablemetadata.txt",
package="W4MRUtils"
)
## import considering # is not a comment character
A <- W4MRUtils::import2(dm_path, meta_path, "variable")
print(A$dataMatrix[1:5, 1:5])
print(A$metadata[1:5, ])
## import considering # is a comment character
B <- W4MRUtils::import2(dm_path, meta_path, "variable", disable_comm = FALSE)
print(B$dataMatrix[1:5, 1:5])
print(B$metadata[1:5, ])